<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>text - ClueLib</title><link rel="stylesheet" type="text/css" href="../styles/main.css"><script language=JavaScript src="../javascript/main.js"></script><script language=JavaScript src="../javascript/prettify.js"></script></head><body class="FramedContentPage" onLoad="NDOnLoad();prettyPrint();"><script language=JavaScript><!--
if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script>

<!--  Generated by Natural Docs, version 1.52 -->
<!--  http://www.naturaldocs.org  -->

<!-- saved from url=(0026)http://www.naturaldocs.org -->




<div id=Content><div class="CClass"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="text"></a>text</h1><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">virtual class text</td></tr></table></blockquote><p>Provides utility functions for text processing.&nbsp;  All functions are defined as static.</p><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SMain"><td class=SEntry><a href="#text" id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">text</a></td><td class=SDescription>Provides utility functions for text processing. </td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#text.Common_Arguments" >Common Arguments</a></td><td class=SDescription></td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#text.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#text.capitalize" id=link2 onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')">capitalize</a></td><td class=SDescription><span class="static">static</span> Returns a copy of the given string with the first character uppercased and the remainder lowercased.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#text.center" id=link3 onMouseOver="ShowTip(event, 'tt3', 'link3')" onMouseOut="HideTip('tt3')">center</a></td><td class=SDescription><span class="static">static</span> Returns a string of the specified width with the given string centerted and padded with the specified character.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#text.change" id=link4 onMouseOver="ShowTip(event, 'tt4', 'link4')" onMouseOut="HideTip('tt4')">change</a></td><td class=SDescription><span class="static">static</span> Returns a copy of the given string with the characters in the specified range replaced with the specified substring.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#text.chomp" id=link5 onMouseOver="ShowTip(event, 'tt5', 'link5')" onMouseOut="HideTip('tt5')">chomp</a></td><td class=SDescription><span class="static">static</span> Returns a copy of the given string with the last newline character removed (if present). </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#text.chop" id=link6 onMouseOver="ShowTip(event, 'tt6', 'link6')" onMouseOut="HideTip('tt6')">chop</a></td><td class=SDescription><span class="static">static</span> Returns the last character of the given string.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#text.colorize" id=link7 onMouseOver="ShowTip(event, 'tt7', 'link7')" onMouseOut="HideTip('tt7')">colorize</a></td><td class=SDescription><span class="static">static</span> Returns a copy of the given string with ANSI escape codes.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#text.contains" id=link8 onMouseOver="ShowTip(event, 'tt8', 'link8')" onMouseOut="HideTip('tt8')">contains</a></td><td class=SDescription><span class="static">static</span> Returns 1 if the given string contains the specified substring.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#text.contains_str" id=link9 onMouseOver="ShowTip(event, 'tt9', 'link9')" onMouseOut="HideTip('tt9')">contains_str</a></td><td class=SDescription><span class="static">static</span> If the given string contains the specified substring, returns that substring.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#text.count" id=link10 onMouseOver="ShowTip(event, 'tt10', 'link10')" onMouseOut="HideTip('tt10')">count</a></td><td class=SDescription><span class="static">static</span> Returns the number of non-overlapping occurrences of the specified substring in the given string.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#text.delete" id=link11 onMouseOver="ShowTip(event, 'tt11', 'link11')" onMouseOut="HideTip('tt11')">delete</a></td><td class=SDescription><span class="static">static</span> Returns a copy of the given string with the specified string removed.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#text.ends_with" id=link12 onMouseOver="ShowTip(event, 'tt12', 'link12')" onMouseOut="HideTip('tt12')">ends_with</a></td><td class=SDescription><span class="static">static</span> Returns 1 if the given string ends with one of the specified suffixes.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#text.find_any" id=link13 onMouseOver="ShowTip(event, 'tt13', 'link13')" onMouseOut="HideTip('tt13')">find_any</a></td><td class=SDescription><span class="static">static</span> Returns the lowest index in the given string where each specified substring is found.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#text.hash" id=link14 onMouseOver="ShowTip(event, 'tt14', 'link14')" onMouseOut="HideTip('tt14')">hash</a></td><td class=SDescription><span class="static">static</span> Returns the hash value of the given string. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#text.index" id=link15 onMouseOver="ShowTip(event, 'tt15', 'link15')" onMouseOut="HideTip('tt15')">index</a></td><td class=SDescription><span class="static">static</span> Returns the index of the first occurrence of the specified substring in the given string within the optionally specified range.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#text.insert" id=link16 onMouseOver="ShowTip(event, 'tt16', 'link16')" onMouseOut="HideTip('tt16')">insert</a></td><td class=SDescription><span class="static">static</span> Returns a copy of the given string with the specified substring inserted at the specified position.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#text.is_alpha" id=link17 onMouseOver="ShowTip(event, 'tt17', 'link17')" onMouseOut="HideTip('tt17')">is_alpha</a></td><td class=SDescription><span class="static">static</span> Returns 1 if all characters in the given string are alphabetic. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#text.is_digit" id=link18 onMouseOver="ShowTip(event, 'tt18', 'link18')" onMouseOut="HideTip('tt18')">is_digit</a></td><td class=SDescription><span class="static">static</span> Returns 1 if all characters in the given string are digits. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#text.is_lower" id=link19 onMouseOver="ShowTip(event, 'tt19', 'link19')" onMouseOut="HideTip('tt19')">is_lower</a></td><td class=SDescription><span class="static">static</span> Returns 1 if all <u>cased</u> characters in the given string are lowercase. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#text.is_printable" id=link20 onMouseOver="ShowTip(event, 'tt20', 'link20')" onMouseOut="HideTip('tt20')">is_printable</a></td><td class=SDescription><span class="static">static</span> Returns 1 if all characters in the given string are printable. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#text.is_single_bit_type" id=link21 onMouseOver="ShowTip(event, 'tt21', 'link21')" onMouseOut="HideTip('tt21')">is_single_bit_type</a></td><td class=SDescription><span class="static">static</span> Returns 1 if the given string is <b>bit</b>, <b>logic</b>, or <b>reg</b>.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#text.is_space" id=link22 onMouseOver="ShowTip(event, 'tt22', 'link22')" onMouseOut="HideTip('tt22')">is_space</a></td><td class=SDescription><span class="static">static</span> Returns 1 if all characters in the given string are whitespace characters: a space (&ldquo; &ldquo;), a tab (<b>\t</b>), or a newline (<b>\n</b>).</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#text.is_upper" id=link23 onMouseOver="ShowTip(event, 'tt23', 'link23')" onMouseOut="HideTip('tt23')">is_upper</a></td><td class=SDescription><span class="static">static</span> Returns 1 if all <u>cased</u> characters in the given string are uppercase. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#text.join_str" id=link24 onMouseOver="ShowTip(event, 'tt24', 'link24')" onMouseOut="HideTip('tt24')">join_str</a></td><td class=SDescription><span class="static">static</span> Returns a string by concatenating the strings in the given string queue, separated by the specified separator.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#text.lc_first" id=link25 onMouseOver="ShowTip(event, 'tt25', 'link25')" onMouseOut="HideTip('tt25')">lc_first</a></td><td class=SDescription><span class="static">static</span> Returns a copy of the given string with the first character lowercased and the remainder unchanged.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#text.ljust" id=link26 onMouseOver="ShowTip(event, 'tt26', 'link26')" onMouseOut="HideTip('tt26')">ljust</a></td><td class=SDescription><span class="static">static</span> Returns a string of the specified width with the given string left justified and padded with the specified character.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#text.lstrip" id=link27 onMouseOver="ShowTip(event, 'tt27', 'link27')" onMouseOut="HideTip('tt27')">lstrip</a></td><td class=SDescription><span class="static">static</span> Returns a copy of the given string with leading characters removed.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#text.only" id=link28 onMouseOver="ShowTip(event, 'tt28', 'link28')" onMouseOut="HideTip('tt28')">only</a></td><td class=SDescription><span class="static">static</span> Returns 1 if the given string consists of only the specified set of characters.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#text.partition" id=link29 onMouseOver="ShowTip(event, 'tt29', 'link29')" onMouseOut="HideTip('tt29')">partition</a></td><td class=SDescription><span class="static">static</span> Searches the first occurrence of the specified separator in the given string and returns an array of three strings. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#text.replace" id=link30 onMouseOver="ShowTip(event, 'tt30', 'link30')" onMouseOut="HideTip('tt30')">replace</a></td><td class=SDescription><span class="static">static</span> Returns a copy of the given string with the specified string replaced with a new string.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#text.reverse" id=link31 onMouseOver="ShowTip(event, 'tt31', 'link31')" onMouseOut="HideTip('tt31')">reverse</a></td><td class=SDescription><span class="static">static</span> Returns a copy of the given string with the characters in reverse order.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#text.rfind_any" id=link32 onMouseOver="ShowTip(event, 'tt32', 'link32')" onMouseOut="HideTip('tt32')">rfind_any</a></td><td class=SDescription><span class="static">static</span> Returns the highest index in the given string where each specified substring is found.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#text.rindex" id=link33 onMouseOver="ShowTip(event, 'tt33', 'link33')" onMouseOut="HideTip('tt33')">rindex</a></td><td class=SDescription><span class="static">static</span> Returns the index of the last occurrence of the specified substring in the given string within the optionally specified range.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#text.rjust" id=link34 onMouseOver="ShowTip(event, 'tt34', 'link34')" onMouseOut="HideTip('tt34')">rjust</a></td><td class=SDescription><span class="static">static</span> Returns a string of the specified width with the given string right justified and padded with the specified character.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#text.rpartition" id=link35 onMouseOver="ShowTip(event, 'tt35', 'link35')" onMouseOut="HideTip('tt35')">rpartition</a></td><td class=SDescription><span class="static">static</span> Searches the last occurrence of the specified separator in the given string and returns an array of three strings. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#text.rsplit" id=link36 onMouseOver="ShowTip(event, 'tt36', 'link36')" onMouseOut="HideTip('tt36')">rsplit</a></td><td class=SDescription><span class="static">static</span> Returns a queue of substrings by dividing the given string by the specified separator from the right.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#text.rstrip" id=link37 onMouseOver="ShowTip(event, 'tt37', 'link37')" onMouseOut="HideTip('tt37')">rstrip</a></td><td class=SDescription><span class="static">static</span> Returns a copy of the given string with trailing characters removed.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#text.slice" id=link38 onMouseOver="ShowTip(event, 'tt38', 'link38')" onMouseOut="HideTip('tt38')">slice</a></td><td class=SDescription><span class="static">static</span> Returns a substring in the specified range. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#text.slice_len" id=link39 onMouseOver="ShowTip(event, 'tt39', 'link39')" onMouseOut="HideTip('tt39')">slice_len</a></td><td class=SDescription><span class="static">static</span> Returns a substring in the specified range. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#text.split" id=link40 onMouseOver="ShowTip(event, 'tt40', 'link40')" onMouseOut="HideTip('tt40')">split</a></td><td class=SDescription><span class="static">static</span> Returns a queue of substrings by dividing the given string by the specified separator.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#text.starts_with" id=link41 onMouseOver="ShowTip(event, 'tt41', 'link41')" onMouseOut="HideTip('tt41')">starts_with</a></td><td class=SDescription><span class="static">static</span> Returns 1 if the given string starts with one of the specified prefixes.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#text.strip" id=link42 onMouseOver="ShowTip(event, 'tt42', 'link42')" onMouseOut="HideTip('tt42')">strip</a></td><td class=SDescription><span class="static">static</span> Returns a copy of the given string with leading and trailing characters removed.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#text.swap_case" id=link43 onMouseOver="ShowTip(event, 'tt43', 'link43')" onMouseOut="HideTip('tt43')">swap_case</a></td><td class=SDescription><span class="static">static</span> Returns a copy of the given string with uppercase characters converted to lowercase, and lowercase characters converted to uppercase.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#text.title_case" id=link44 onMouseOver="ShowTip(event, 'tt44', 'link44')" onMouseOut="HideTip('tt44')">title_case</a></td><td class=SDescription><span class="static">static</span> Returns a copy of the given string with the first character of words uppercased and the remainder lowercased.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#text.trim" id=link45 onMouseOver="ShowTip(event, 'tt45', 'link45')" onMouseOut="HideTip('tt45')">trim</a></td><td class=SDescription><span class="static">static</span> Returns a copy of the given string with the specified numbers of leading and trailing characters removed.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#text.uc_first" id=link46 onMouseOver="ShowTip(event, 'tt46', 'link46')" onMouseOut="HideTip('tt46')">uc_first</a></td><td class=SDescription><span class="static">static</span> Returns a copy of the given string with the first character uppercased and the remainder unchanged.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#text.untabify" id=link47 onMouseOver="ShowTip(event, 'tt47', 'link47')" onMouseOut="HideTip('tt47')">untabify</a></td><td class=SDescription><span class="static">static</span> Returns a copy of the given string where all tab characters (<b>\t</b>) are replaced by one or more spaces, depending on the tab positions. </td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="text.Common_Arguments"></a>Common Arguments</h3><div class=CBody><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>start_pos</td><td class=CDLDescription>Specifies the start position in a string.&nbsp;  The position of the first character is 0, the position of the second character is 1, and so on.&nbsp; The position can be specified as a negative number.&nbsp; The position of the last character can be specified as -1, the position of the second to the last character can be specified as -2, and so on.&nbsp; The default is 0 (the first character).</td></tr><tr><td class=CDLEntry>end_pos</td><td class=CDLDescription>Specifies the end position in a string using the same rule as the <b>start_pos</b>.&nbsp; The default is -1 (the last character).</td></tr></table><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">      ____ position 0 or -26
     /    ____ position 5 or -21
    /    /         ____ position 15 or -11
   /    /         /         ____ position 25 or -1
  /    /         /         /
 V    V         V         V
&quot;How common arguments work.&quot;
 |-----------------------&gt;| start_pos =   0, end_pos =  25 \
 |-----------------------&gt;| start_pos =   0, end_pos =  -1  \ these specify the same range of the string
 |-----------------------&gt;| start_pos = -26, end_pos =  25  /
 |-----------------------&gt;| start_pos = -26, end_pos =  -1 /
      |--------&gt;|           start_pos =   5, end_pos =  15 \
      |--------&gt;|           start_pos =   5, end_pos = -11  \ these specify the same range of the string
      |--------&gt;|           start_pos = -21, end_pos =  15  /
      |--------&gt;|           start_pos = -21, end_pos = -11 /</pre></blockquote></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="text.Functions"></a>Functions</h3></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="text.capitalize"></a>capitalize</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string capitalize(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Returns a copy of the given string with the first character uppercased and the remainder lowercased.</p><h4 class=CHeading>Argument</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>s</td><td class=CDLDescription>A string to be capitalized.</td></tr></table><h4 class=CHeading>Returns</h4><p>A copy of <b>s</b> with the first character uppercased and the remainder lowercased.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">assert( text::capitalize( &quot;capitalize me!&quot; ) == &quot;Capitalize me!&quot; );</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#text.lc_first" class=LFunction id=link48 onMouseOver="ShowTip(event, 'tt25', 'link48')" onMouseOut="HideTip('tt25')">lc_first</a>, <a href="#text.swap_case" class=LFunction id=link49 onMouseOver="ShowTip(event, 'tt43', 'link49')" onMouseOut="HideTip('tt43')">swap_case</a>, <a href="#text.title_case" class=LFunction id=link50 onMouseOver="ShowTip(event, 'tt44', 'link50')" onMouseOut="HideTip('tt44')">title_case</a>, <a href="#text.uc_first" class=LFunction id=link51 onMouseOver="ShowTip(event, 'tt46', 'link51')" onMouseOut="HideTip('tt46')">uc_first</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="text.center"></a>center</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string center(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>width,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>byte&nbsp;</td><td class="PParameter  prettyprint " nowrap>fill_char</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> &quot; &quot;,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>bit&nbsp;</td><td class="PParameter  prettyprint " nowrap>trim_ends</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Returns a string of the specified width with the given string centerted and padded with the specified character.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>s</td><td class=CDLDescription>A string to be centered.</td></tr><tr><td class=CDLEntry>width</td><td class=CDLDescription>The width of the returned string.</td></tr><tr><td class=CDLEntry>fill_char</td><td class=CDLDescription><span class="optional">optional</span> The character used for padding if <b>width</b> is wider than the length of <b>s</b>.&nbsp;  The default is a space character (&ldquo; &ldquo;).</td></tr><tr><td class=CDLEntry>trim_ends</td><td class=CDLDescription><span class="optional">optional</span> If <b>width</b> is narrower than the length of <b>s</b> and <b>trim_ends</b> is 1, then the head and the tail of <b>s</b> are trimmed to fit within <b>width</b>.&nbsp; If <b>trim_ends</b> is 0, then <b>width</b> is widened to the length of <b>s</b>.&nbsp;  If <b>width</b> is wider than or equal to the length of <b>s</b>, <b>trim_ends</b> is ignored.&nbsp;  The default is 0.</td></tr></table><h4 class=CHeading>Returns</h4><p>A string with <b>s</b> placed at the center and padded with <b>fill_char</b>.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">assert( text::center( &quot;center me&quot;, 15 )                 == &quot;   center me   &quot; );
assert( text::center( &quot;center me&quot;, 15, &quot;-&quot; )            == &quot;---center me---&quot; );
assert( text::center( &quot;center me&quot;, 7 )                  ==    &quot;center me&quot;    ); // widened to fit
assert( text::center( &quot;center me&quot;, 7, .trim_ends( 1 ) ) ==     &quot;enter m&quot;     ); // trimmed</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#text.ljust" class=LFunction id=link52 onMouseOver="ShowTip(event, 'tt26', 'link52')" onMouseOut="HideTip('tt26')">ljust</a>, <a href="#text.rjust" class=LFunction id=link53 onMouseOver="ShowTip(event, 'tt34', 'link53')" onMouseOut="HideTip('tt34')">rjust</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="text.change"></a>change</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string change(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>sub,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>start_pos</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>end_pos</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> -1</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Returns a copy of the given string with the characters in the specified range replaced with the specified substring.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>s</td><td class=CDLDescription>A string to be changed.</td></tr><tr><td class=CDLEntry>sub</td><td class=CDLDescription>A substring.</td></tr><tr><td class=CDLEntry>start_pos</td><td class=CDLDescription><span class="optional">optional</span> Specifies the left-most position in <b>s</b> to be replaced.&nbsp; See <a href="#text.Common_Arguments" class=LGroup >Common Arguments</a>.</td></tr><tr><td class=CDLEntry>end_pos</td><td class=CDLDescription><span class="optional">optional</span> Specifies the right-most position in <b>s</b> to be replaced.&nbsp; See <a href="#text.Common_Arguments" class=LGroup >Common Arguments</a>.</td></tr></table><h4 class=CHeading>Returns</h4><p>A copy of <b>s</b> with the characters in the specified range replaced with <b>sub</b>.&nbsp; If the specified range is invalid, <b>s</b> is returned without a change.&nbsp; If <b>s</b> is an empty string (&ldquo;&rdquo;), no change is made.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">assert( text::change( &quot;a primary library&quot;, &quot;function&quot;, .start_pos( 10 ) ) == &quot;a primary function&quot; );
//                               |----&gt;|
//                              10</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#text.replace" class=LFunction id=link54 onMouseOver="ShowTip(event, 'tt30', 'link54')" onMouseOut="HideTip('tt30')">replace</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="text.chomp"></a>chomp</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string chomp(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Returns a copy of the given string with the last newline character removed (if present).&nbsp; Returns the given string as is if the given string does not end in a newline character.</p><h4 class=CHeading>Argument</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>s</td><td class=CDLDescription>A string to be chomped</td></tr></table><h4 class=CHeading>Returns</h4><p>Returns a copy of <b>s</b> with the last newline character removed (if present).&nbsp; Returns <b>s</b> as is if the given string does not end in a newline character.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">assert( text::chomp( &quot;abc&quot;     ) == &quot;abc&quot; );
assert( text::chomp( &quot;abc\n&quot;   ) == &quot;abc&quot; );
assert( text::chomp( &quot;abc\n\n&quot; ) == &quot;abc\n&quot; );</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#text.chop" class=LFunction id=link55 onMouseOver="ShowTip(event, 'tt6', 'link55')" onMouseOut="HideTip('tt6')">chop</a>, <a href="#text.delete" class=LFunction id=link56 onMouseOver="ShowTip(event, 'tt11', 'link56')" onMouseOut="HideTip('tt11')">delete</a>, <a href="#text.lstrip" class=LFunction id=link57 onMouseOver="ShowTip(event, 'tt27', 'link57')" onMouseOut="HideTip('tt27')">lstrip</a>, <a href="#text.rstrip" class=LFunction id=link58 onMouseOver="ShowTip(event, 'tt37', 'link58')" onMouseOut="HideTip('tt37')">rstrip</a>, <a href="#text.strip" class=LFunction id=link59 onMouseOver="ShowTip(event, 'tt42', 'link59')" onMouseOut="HideTip('tt42')">strip</a>, <a href="#text.trim" class=LFunction id=link60 onMouseOver="ShowTip(event, 'tt45', 'link60')" onMouseOut="HideTip('tt45')">trim</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="text.chop"></a>chop</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function byte chop(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Returns the last character of the given string.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>s</td><td class=CDLDescription>An input string.</td></tr></table><h4 class=CHeading>Returns</h4><p>Returns the last character of <b>s</b>.&nbsp; If <b>s</b> is empty, 0 is returned.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">assert( text::chop( &quot;abc&quot; ) == &quot;c&quot; );
assert( text::chop( &quot;abc\n&quot; ) == &quot;\n&quot; );</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#text.chomp" class=LFunction id=link61 onMouseOver="ShowTip(event, 'tt5', 'link61')" onMouseOut="HideTip('tt5')">chomp</a>, <a href="#text.delete" class=LFunction id=link62 onMouseOver="ShowTip(event, 'tt11', 'link62')" onMouseOut="HideTip('tt11')">delete</a>, <a href="#text.lstrip" class=LFunction id=link63 onMouseOver="ShowTip(event, 'tt27', 'link63')" onMouseOut="HideTip('tt27')">lstrip</a>, <a href="#text.rstrip" class=LFunction id=link64 onMouseOver="ShowTip(event, 'tt37', 'link64')" onMouseOut="HideTip('tt37')">rstrip</a>, <a href="#text.strip" class=LFunction id=link65 onMouseOver="ShowTip(event, 'tt42', 'link65')" onMouseOut="HideTip('tt42')">strip</a>, <a href="#text.trim" class=LFunction id=link66 onMouseOver="ShowTip(event, 'tt45', 'link66')" onMouseOut="HideTip('tt45')">trim</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="text.colorize"></a>colorize</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string colorize(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>fg_color_e&nbsp;</td><td class="PParameter  prettyprint " nowrap>fg</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> FG_BLACK,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>bg_color_e&nbsp;</td><td class="PParameter  prettyprint " nowrap>bg</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> BG_WHITE,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>bit&nbsp;</td><td class="PParameter  prettyprint " nowrap>bold</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>bit&nbsp;</td><td class="PParameter  prettyprint " nowrap>underline</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>bit&nbsp;</td><td class="PParameter  prettyprint " nowrap>blink</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>bit&nbsp;</td><td class="PParameter  prettyprint " nowrap>reverse</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Returns a copy of the given string with ANSI escape codes.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>s</td><td class=CDLDescription>A string to be colorized.</td></tr><tr><td class=CDLEntry>fg</td><td class=CDLDescription><span class="optional">optional</span> The foreground color of <b>s</b>.&nbsp; See <a href="cl_types-svh.html#fg_color_e" class=LType id=link67 onMouseOver="ShowTip(event, 'tt48', 'link67')" onMouseOut="HideTip('tt48')">fg_color_e</a> for available colors.&nbsp; The default is black.</td></tr><tr><td class=CDLEntry>bg</td><td class=CDLDescription><span class="optional">optional</span> The background color of <b>s</b>.&nbsp; See <a href="cl_types-svh.html#bg_color_e" class=LType id=link68 onMouseOver="ShowTip(event, 'tt49', 'link68')" onMouseOut="HideTip('tt49')">bg_color_e</a> for available colors.&nbsp; The default is white.</td></tr><tr><td class=CDLEntry>bold</td><td class=CDLDescription><span class="optional">optional</span> If 1, <b>s</b> is boldfaced.&nbsp; The default is 0.</td></tr><tr><td class=CDLEntry>underline</td><td class=CDLDescription><span class="optional">optional</span> If 1, <b>s</b> is underlined.&nbsp; The default is 0.</td></tr><tr><td class=CDLEntry>blink</td><td class=CDLDescription><span class="optional">optional</span> If 1, <b>s</b> is blinked.&nbsp; The default is 0.</td></tr><tr><td class=CDLEntry>reverse</td><td class=CDLDescription><span class="optional">optional</span> If 1, the foreground and the background colors of <b>s</b> are reversed.&nbsp; The default is 0.</td></tr></table><h4 class=CHeading>Returns</h4><p>A copy of <b>s</b> with ANSI escape codes.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">$display( text::colorize( &quot;display me in red&quot;, FG_RED ) );</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="text.contains"></a>contains</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function bit contains(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>sub,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>start_pos</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>end_pos</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> -1</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Returns 1 if the given string contains the specified substring.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>s</td><td class=CDLDescription>An input string.</td></tr><tr><td class=CDLEntry>sub</td><td class=CDLDescription>A substring to search.&nbsp; An empty substring (&ldquo;&rdquo;) matches no input string.</td></tr><tr><td class=CDLEntry>start_pos</td><td class=CDLDescription><span class="optional">optional</span> Specifies the position in <b>s</b> to begin the search.&nbsp; See <a href="#text.Common_Arguments" class=LGroup >Common Arguments</a>.</td></tr><tr><td class=CDLEntry>end_pos</td><td class=CDLDescription><span class="optional">optional</span> Specifies the position in <b>s</b> to end the search.&nbsp; See <a href="#text.Common_Arguments" class=LGroup >Common Arguments</a>.</td></tr></table><h4 class=CHeading>Returns</h4><p>If <b>s</b> contains <b>sub</b>, 1 is returned.&nbsp; Otherwise, 0 is returned.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">assert( text::contains( &quot;a primary library&quot;, &quot;primary&quot; )                  == 1 );
assert( text::contains( &quot;a primary library&quot;, &quot;primary&quot;, .start_pos( 3 ) ) == 0 );
//                          |-----------&gt;|
//                          3
assert( text::contains( &quot;a primary library&quot;, &quot;primary&quot;, .end_pos(  7 ) )  == 0 );
//                       |-----&gt;|
//                              7
assert( text::contains( &quot;a primary library&quot;, &quot;primary&quot;, .end_pos( -9 ) )  == 1 );
//                       |------&gt;|
//                              -9</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#text.contains_str" class=LFunction id=link69 onMouseOver="ShowTip(event, 'tt9', 'link69')" onMouseOut="HideTip('tt9')">contains_str</a>, <a href="#text.count" class=LFunction id=link70 onMouseOver="ShowTip(event, 'tt10', 'link70')" onMouseOut="HideTip('tt10')">count</a>, <a href="#text.ends_with" class=LFunction id=link71 onMouseOver="ShowTip(event, 'tt12', 'link71')" onMouseOut="HideTip('tt12')">ends_with</a>, <a href="#text.find_any" class=LFunction id=link72 onMouseOver="ShowTip(event, 'tt13', 'link72')" onMouseOut="HideTip('tt13')">find_any</a>, <a href="#text.index" class=LFunction id=link73 onMouseOver="ShowTip(event, 'tt15', 'link73')" onMouseOut="HideTip('tt15')">index</a>, <a href="#text.only" class=LFunction id=link74 onMouseOver="ShowTip(event, 'tt28', 'link74')" onMouseOut="HideTip('tt28')">only</a>, <a href="#text.rfind_any" class=LFunction id=link75 onMouseOver="ShowTip(event, 'tt32', 'link75')" onMouseOut="HideTip('tt32')">rfind_any</a>, <a href="#text.rindex" class=LFunction id=link76 onMouseOver="ShowTip(event, 'tt33', 'link76')" onMouseOut="HideTip('tt33')">rindex</a>, <a href="#text.starts_with" class=LFunction id=link77 onMouseOver="ShowTip(event, 'tt41', 'link77')" onMouseOut="HideTip('tt41')">starts_with</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="text.contains_str"></a>contains_str</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string contains_str(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>sub,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>start_pos</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>end_pos</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> -1</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> If the given string contains the specified substring, returns that substring.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>s</td><td class=CDLDescription>An input string.</td></tr><tr><td class=CDLEntry>sub</td><td class=CDLDescription>A substring to search.&nbsp;  An empty substring (&ldquo;&rdquo;) matches no input string.</td></tr><tr><td class=CDLEntry>start_pos</td><td class=CDLDescription><span class="optional">optional</span> Specifies the position in <b>s</b> to begin the search.&nbsp; See <a href="#text.Common_Arguments" class=LGroup >Common Arguments</a>.</td></tr><tr><td class=CDLEntry>end_pos</td><td class=CDLDescription><span class="optional">optional</span> Specifies the position in <b>s</b> to end the search.&nbsp; See <a href="#text.Common_Arguments" class=LGroup >Common Arguments</a>.</td></tr></table><h4 class=CHeading>Returns</h4><p>If <b>s</b> contains <b>sub</b>, <b>sub</b> is returned.&nbsp; Otherwise, an empty string (&ldquo;&rdquo;) is returned.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">assert( text::contains_str( &quot;a primary library&quot;, &quot;primary&quot; )                  == &quot;primary&quot; );
assert( text::contains_str( &quot;a primary library&quot;, &quot;primary&quot;, .start_pos( 3 ) ) == &quot;&quot; );
//                              |-----------&gt;|
//                              3
assert( text::contains_str( &quot;a primary library&quot;, &quot;primary&quot;, .end_pos(  7 ) )  == &quot;&quot; );
//                           |-----&gt;|
//                                  7
assert( text::contains_str( &quot;a primary library&quot;, &quot;primary&quot;, .end_pos( -9 ) )  == &quot;primary&quot; );
//                           |------&gt;|
//                                  -9</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#text.contains" class=LFunction id=link78 onMouseOver="ShowTip(event, 'tt8', 'link78')" onMouseOut="HideTip('tt8')">contains</a>, <a href="#text.count" class=LFunction id=link79 onMouseOver="ShowTip(event, 'tt10', 'link79')" onMouseOut="HideTip('tt10')">count</a>, <a href="#text.ends_with" class=LFunction id=link80 onMouseOver="ShowTip(event, 'tt12', 'link80')" onMouseOut="HideTip('tt12')">ends_with</a>, <a href="#text.find_any" class=LFunction id=link81 onMouseOver="ShowTip(event, 'tt13', 'link81')" onMouseOut="HideTip('tt13')">find_any</a>, <a href="#text.index" class=LFunction id=link82 onMouseOver="ShowTip(event, 'tt15', 'link82')" onMouseOut="HideTip('tt15')">index</a>, <a href="#text.only" class=LFunction id=link83 onMouseOver="ShowTip(event, 'tt28', 'link83')" onMouseOut="HideTip('tt28')">only</a>, <a href="#text.rfind_any" class=LFunction id=link84 onMouseOver="ShowTip(event, 'tt32', 'link84')" onMouseOut="HideTip('tt32')">rfind_any</a>, <a href="#text.rindex" class=LFunction id=link85 onMouseOver="ShowTip(event, 'tt33', 'link85')" onMouseOut="HideTip('tt33')">rindex</a>, <a href="#text.starts_with" class=LFunction id=link86 onMouseOver="ShowTip(event, 'tt41', 'link86')" onMouseOut="HideTip('tt41')">starts_with</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="text.count"></a>count</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function int unsigned count(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>sub,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>start_pos</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>end_pos</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> -1</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Returns the number of non-overlapping occurrences of the specified substring in the given string.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>s</td><td class=CDLDescription>An input string.</td></tr><tr><td class=CDLEntry>sub</td><td class=CDLDescription>A substring to search.&nbsp;  An empty substring (&ldquo;&rdquo;) matches no input string.</td></tr><tr><td class=CDLEntry>start_pos</td><td class=CDLDescription><span class="optional">optional</span> Specifies the position in <b>s</b> to begin the search.&nbsp;  See <a href="#text.Common_Arguments" class=LGroup >Common Arguments</a>.</td></tr><tr><td class=CDLEntry>end_pos</td><td class=CDLDescription><span class="optional">optional</span> Specifies the position in <b>s</b> to end the search.&nbsp; See <a href="#text.Common_Arguments" class=LGroup >Common Arguments</a>.</td></tr></table><h4 class=CHeading>Returns</h4><p>The number of non-overlapping occurrences of <b>sub</b> in <b>s</b>.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">assert( text::count( &quot;a primary library&quot;, &quot;ary&quot; )                  == 2 );
assert( text::count( &quot;a primary library&quot;, &quot;ary&quot;, .start_pos( 3 ) ) == 2 );
//                       |-----------&gt;|
//                       3
assert( text::count( &quot;a primary library&quot;, &quot;ary&quot;, .end_pos(  7 ) )  == 0 );
//                    |-----&gt;|
//                           7
assert( text::count( &quot;a primary library&quot;, &quot;ary&quot;, .end_pos( -9 ) )  == 1 );
//                    |------&gt;|
//                           -9</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#text.contains" class=LFunction id=link87 onMouseOver="ShowTip(event, 'tt8', 'link87')" onMouseOut="HideTip('tt8')">contains</a>, <a href="#text.contains_str" class=LFunction id=link88 onMouseOver="ShowTip(event, 'tt9', 'link88')" onMouseOut="HideTip('tt9')">contains_str</a>, <a href="#text.ends_with" class=LFunction id=link89 onMouseOver="ShowTip(event, 'tt12', 'link89')" onMouseOut="HideTip('tt12')">ends_with</a>, <a href="#text.find_any" class=LFunction id=link90 onMouseOver="ShowTip(event, 'tt13', 'link90')" onMouseOut="HideTip('tt13')">find_any</a>, <a href="#text.index" class=LFunction id=link91 onMouseOver="ShowTip(event, 'tt15', 'link91')" onMouseOut="HideTip('tt15')">index</a>, <a href="#text.only" class=LFunction id=link92 onMouseOver="ShowTip(event, 'tt28', 'link92')" onMouseOut="HideTip('tt28')">only</a>, <a href="#text.rfind_any" class=LFunction id=link93 onMouseOver="ShowTip(event, 'tt32', 'link93')" onMouseOut="HideTip('tt32')">rfind_any</a>, <a href="#text.rindex" class=LFunction id=link94 onMouseOver="ShowTip(event, 'tt33', 'link94')" onMouseOut="HideTip('tt33')">rindex</a>, <a href="#text.starts_with" class=LFunction id=link95 onMouseOver="ShowTip(event, 'tt41', 'link95')" onMouseOut="HideTip('tt41')">starts_with</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="text.delete"></a>delete</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string delete(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>sub,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>count</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> -1</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Returns a copy of the given string with the specified string removed.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>s</td><td class=CDLDescription>An input string.</td></tr><tr><td class=CDLEntry>sub</td><td class=CDLDescription>A substring to remove.&nbsp; An empty substring (&ldquo;&rdquo;) matches no input string.</td></tr><tr><td class=CDLEntry>count</td><td class=CDLDescription><span class="optional">optional</span> The number of substrings to remove.&nbsp; If specified, only the first <b>count</b> occurrences are removed.&nbsp; By default, all occurrences are removed.</td></tr></table><h4 class=CHeading>Returns</h4><p>A copy of <b>s</b> with the first <b>count</b> occurrences of <b>sub</b> removed.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">assert( text::delete( &quot;abcabc&quot;, &quot;abc&quot;    ) == &quot;&quot; );
assert( text::delete( &quot;abcabc&quot;, &quot;abc&quot;, 1 ) == &quot;abc&quot; );</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#text.chop" class=LFunction id=link96 onMouseOver="ShowTip(event, 'tt6', 'link96')" onMouseOut="HideTip('tt6')">chop</a>, <a href="#text.chomp" class=LFunction id=link97 onMouseOver="ShowTip(event, 'tt5', 'link97')" onMouseOut="HideTip('tt5')">chomp</a>, <a href="#text.insert" class=LFunction id=link98 onMouseOver="ShowTip(event, 'tt16', 'link98')" onMouseOut="HideTip('tt16')">insert</a>, <a href="#text.lstrip" class=LFunction id=link99 onMouseOver="ShowTip(event, 'tt27', 'link99')" onMouseOut="HideTip('tt27')">lstrip</a>, <a href="#text.rstrip" class=LFunction id=link100 onMouseOver="ShowTip(event, 'tt37', 'link100')" onMouseOut="HideTip('tt37')">rstrip</a>, <a href="#text.strip" class=LFunction id=link101 onMouseOver="ShowTip(event, 'tt42', 'link101')" onMouseOut="HideTip('tt42')">strip</a>, <a href="#text.trim" class=LFunction id=link102 onMouseOver="ShowTip(event, 'tt45', 'link102')" onMouseOut="HideTip('tt45')">trim</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="text.ends_with"></a>ends_with</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function bit ends_with(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>string_q&nbsp;</td><td class="PParameter  prettyprint " nowrap>suffixes,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>start_pos</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>end_pos</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> -1</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Returns 1 if the given string ends with one of the specified suffixes.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>s</td><td class=CDLDescription>An input string.</td></tr><tr><td class=CDLEntry>suffixes</td><td class=CDLDescription>A queue of suffix strings.&nbsp; The suffixes can be specified using an array literal.&nbsp;  An empty string (&ldquo;&rdquo;) matches no input string.</td></tr><tr><td class=CDLEntry>start_pos</td><td class=CDLDescription><span class="optional">optional</span> Specifies the position in <b>s</b> to begin the search.&nbsp; See <a href="#text.Common_Arguments" class=LGroup >Common Arguments</a>.</td></tr><tr><td class=CDLEntry>end_pos</td><td class=CDLDescription><span class="optional">optional</span> Specifies the position in <b>s</b> to end the search.&nbsp; See <a href="#text.Common_Arguments" class=LGroup >Common Arguments</a>.</td></tr></table><h4 class=CHeading>Returns</h4><p>If <b>s</b> ends with one of the specified <b>suffixes</b>, 1 is returned.&nbsp; Otherwise, 0 is returned.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">assert( text::ends_with( &quot;a primary library&quot;, { &quot;primary&quot;, &quot;library&quot; } )                  == 1 );
assert( text::ends_with( &quot;a primary library&quot;, { &quot;primary&quot;, &quot;library&quot; }, .start_pos( 3 ) ) == 1 );
//                           |-----------&gt;|
//                           3
assert( text::ends_with( &quot;a primary library&quot;, { &quot;primary&quot;, &quot;library&quot; }, .end_pos(  7 ) )  == 0 );
//                        |-----&gt;|
//                               7
assert( text::ends_with( &quot;a primary library&quot;, { &quot;primary&quot;, &quot;library&quot; }, .end_pos( -9 ) )  == 1 );
//                        |------&gt;|
//                               -9</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#text.contains" class=LFunction id=link103 onMouseOver="ShowTip(event, 'tt8', 'link103')" onMouseOut="HideTip('tt8')">contains</a>, <a href="#text.contains_str" class=LFunction id=link104 onMouseOver="ShowTip(event, 'tt9', 'link104')" onMouseOut="HideTip('tt9')">contains_str</a>, <a href="#text.count" class=LFunction id=link105 onMouseOver="ShowTip(event, 'tt10', 'link105')" onMouseOut="HideTip('tt10')">count</a>, <a href="#text.find_any" class=LFunction id=link106 onMouseOver="ShowTip(event, 'tt13', 'link106')" onMouseOut="HideTip('tt13')">find_any</a>, <a href="#text.index" class=LFunction id=link107 onMouseOver="ShowTip(event, 'tt15', 'link107')" onMouseOut="HideTip('tt15')">index</a>, <a href="#text.only" class=LFunction id=link108 onMouseOver="ShowTip(event, 'tt28', 'link108')" onMouseOut="HideTip('tt28')">only</a>, <a href="#text.rfind_any" class=LFunction id=link109 onMouseOver="ShowTip(event, 'tt32', 'link109')" onMouseOut="HideTip('tt32')">rfind_any</a>, <a href="#text.rindex" class=LFunction id=link110 onMouseOver="ShowTip(event, 'tt33', 'link110')" onMouseOut="HideTip('tt33')">rindex</a>, <a href="#text.starts_with" class=LFunction id=link111 onMouseOver="ShowTip(event, 'tt41', 'link111')" onMouseOut="HideTip('tt41')">starts_with</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="text.find_any"></a>find_any</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function int find_any(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>string_q&nbsp;</td><td class="PParameter  prettyprint " nowrap>subs,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>start_pos</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>end_pos</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> -1</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Returns the lowest index in the given string where each specified substring is found.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>s</td><td class=CDLDescription>An input string.</td></tr><tr><td class=CDLEntry>subs</td><td class=CDLDescription>A queue of substrings.&nbsp; The substrings can be specified using an array literal.&nbsp; An empty substring (&ldquo;&rdquo;) matches no input string.</td></tr><tr><td class=CDLEntry>start_pos</td><td class=CDLDescription><span class="optional">optional</span> Specifies the position in <b>s</b> to begin the search.&nbsp; See <a href="#text.Common_Arguments" class=LGroup >Common Arguments</a>.</td></tr><tr><td class=CDLEntry>end_pos</td><td class=CDLDescription><span class="optional">optional</span> Specifies the position in <b>s</b> to end the search.&nbsp; See <a href="#text.Common_Arguments" class=LGroup >Common Arguments</a>.</td></tr></table><h4 class=CHeading>Returns</h4><p>The lowest index in <b>s</b> where each substring in <b>subs</b> is found.&nbsp; If no substring is found, -1 is returned.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">assert( text::find_any( &quot;a primary library&quot;, { &quot;primary&quot;, &quot;library&quot; } ) ==  2 );
assert( text::find_any( &quot;a primary library&quot;, { &quot;primary&quot;, &quot;library&quot; }, .start_pos( 3 ) ) == 10 );
//                          |-----------&gt;|
//                          3
assert( text::find_any( &quot;a primary library&quot;, { &quot;primary&quot;, &quot;library&quot; }, .end_pos(  7 ) ) == -1 );
//                       |-----&gt;|
//                              7
assert( text::find_any( &quot;a primary library&quot;, { &quot;primary&quot;, &quot;library&quot; }, .end_pos( -9 ) ) ==  2 );
//                       |------&gt;|
//                              -9</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#text.contains" class=LFunction id=link112 onMouseOver="ShowTip(event, 'tt8', 'link112')" onMouseOut="HideTip('tt8')">contains</a>, <a href="#text.contains_str" class=LFunction id=link113 onMouseOver="ShowTip(event, 'tt9', 'link113')" onMouseOut="HideTip('tt9')">contains_str</a>, <a href="#text.count" class=LFunction id=link114 onMouseOver="ShowTip(event, 'tt10', 'link114')" onMouseOut="HideTip('tt10')">count</a>, <a href="#text.ends_with" class=LFunction id=link115 onMouseOver="ShowTip(event, 'tt12', 'link115')" onMouseOut="HideTip('tt12')">ends_with</a>, <a href="#text.index" class=LFunction id=link116 onMouseOver="ShowTip(event, 'tt15', 'link116')" onMouseOut="HideTip('tt15')">index</a>, <a href="#text.only" class=LFunction id=link117 onMouseOver="ShowTip(event, 'tt28', 'link117')" onMouseOut="HideTip('tt28')">only</a>, <a href="#text.rfind_any" class=LFunction id=link118 onMouseOver="ShowTip(event, 'tt32', 'link118')" onMouseOut="HideTip('tt32')">rfind_any</a>, <a href="#text.rindex" class=LFunction id=link119 onMouseOver="ShowTip(event, 'tt33', 'link119')" onMouseOut="HideTip('tt33')">rindex</a>, <a href="#text.starts_with" class=LFunction id=link120 onMouseOver="ShowTip(event, 'tt41', 'link120')" onMouseOut="HideTip('tt41')">starts_with</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="text.hash"></a>hash</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function int hash(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Returns the hash value of the given string.&nbsp; The hash value is calculated by:</p><p>(see hash.png)</p><p>where N is the length of the given string.</p><h4 class=CHeading>Argument</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>s</td><td class=CDLDescription>An input string.</td></tr></table><h4 class=CHeading>Returns</h4><p>The hash value of <b>s</b>.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">assert( text::hash( &quot;my hash value is&quot; ) == 32'he4260597 );</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="text.index"></a>index</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function int index(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>sub,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>start_pos</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>end_pos</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> -1</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Returns the index of the first occurrence of the specified substring in the given string within the optionally specified range.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>s</td><td class=CDLDescription>An input string.</td></tr><tr><td class=CDLEntry>sub</td><td class=CDLDescription>A substring to search.&nbsp; An empty substring (&ldquo;&rdquo;) matches no input string.</td></tr><tr><td class=CDLEntry>start_pos</td><td class=CDLDescription><span class="optional">optional</span> Specifies the position in <b>s</b> to begin the search.&nbsp; See <a href="#text.Common_Arguments" class=LGroup >Common Arguments</a>.</td></tr><tr><td class=CDLEntry>end_pos</td><td class=CDLDescription><span class="optional">optional</span> Specifies the position in <b>s</b> to end the search.&nbsp; See <a href="#text.Common_Arguments" class=LGroup >Common Arguments</a>.</td></tr></table><h4 class=CHeading>Returns</h4><p>The index of the first occurrence of <b>sub</b> in <b>s</b>.&nbsp; If <b>sub</b> is not found, -1 is returned.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">assert( text::index( &quot;a primary library&quot;, &quot;ary&quot; )                  ==  6 );
assert( text::index( &quot;a primary library&quot;, &quot;ary&quot;, .start_pos( 3 ) ) ==  6 );
//                       |-----------&gt;|
//                       3
assert( text::index( &quot;a primary library&quot;, &quot;ary&quot;, .end_pos(  7 ) )  == -1 );
//                    |-----&gt;|
//                           7
assert( text::index( &quot;a primary library&quot;, &quot;ary&quot;, .end_pos( -9 ) )  ==  6 );
//                    |------&gt;|
//                           -9</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#text.contains" class=LFunction id=link121 onMouseOver="ShowTip(event, 'tt8', 'link121')" onMouseOut="HideTip('tt8')">contains</a>, <a href="#text.contains_str" class=LFunction id=link122 onMouseOver="ShowTip(event, 'tt9', 'link122')" onMouseOut="HideTip('tt9')">contains_str</a>, <a href="#text.count" class=LFunction id=link123 onMouseOver="ShowTip(event, 'tt10', 'link123')" onMouseOut="HideTip('tt10')">count</a>, <a href="#text.ends_with" class=LFunction id=link124 onMouseOver="ShowTip(event, 'tt12', 'link124')" onMouseOut="HideTip('tt12')">ends_with</a>, <a href="#text.find_any" class=LFunction id=link125 onMouseOver="ShowTip(event, 'tt13', 'link125')" onMouseOut="HideTip('tt13')">find_any</a>, <a href="#text.only" class=LFunction id=link126 onMouseOver="ShowTip(event, 'tt28', 'link126')" onMouseOut="HideTip('tt28')">only</a>, <a href="#text.rfind_any" class=LFunction id=link127 onMouseOver="ShowTip(event, 'tt32', 'link127')" onMouseOut="HideTip('tt32')">rfind_any</a>, <a href="#text.rindex" class=LFunction id=link128 onMouseOver="ShowTip(event, 'tt33', 'link128')" onMouseOut="HideTip('tt33')">rindex</a>, <a href="#text.starts_with" class=LFunction id=link129 onMouseOver="ShowTip(event, 'tt41', 'link129')" onMouseOut="HideTip('tt41')">starts_with</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="text.insert"></a>insert</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string insert(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>sub,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>start_pos</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Returns a copy of the given string with the specified substring inserted at the specified position.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>s</td><td class=CDLDescription>An input string.</td></tr><tr><td class=CDLEntry>sub</td><td class=CDLDescription>A substring to insert.</td></tr><tr><td class=CDLEntry>start_pos</td><td class=CDLDescription><span class="optional">optional</span> Specifies the position where <b>sub</b> is inserted.&nbsp; See <a href="#text.Common_Arguments" class=LGroup >Common Arguments</a>.&nbsp; The default is 0 (inserting <b>sub</b> before <b>s</b>).</td></tr></table><h4 class=CHeading>Returns</h4><p>A copy of <b>s</b> with <b>sub</b> inserted at <b>start_pos</b>.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">assert( text::insert( &quot;abc&quot;, &quot;XYZ&quot;     ) == &quot;XYZabc&quot; ); // insert &quot;XYZ&quot; before the first character (&quot;a&quot;)
assert( text::insert( &quot;abc&quot;, &quot;XYZ&quot;,  1 ) == &quot;aXYZbc&quot; ); // insert &quot;XYZ&quot; before the character index 1 (&quot;b&quot;)
assert( text::insert( &quot;abc&quot;, &quot;XYZ&quot;, -1 ) == &quot;abXYZc&quot; ); // insert &quot;XYZ&quot; before the last character (&quot;c&quot;)</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#text.chop" class=LFunction id=link130 onMouseOver="ShowTip(event, 'tt6', 'link130')" onMouseOut="HideTip('tt6')">chop</a>, <a href="#text.chomp" class=LFunction id=link131 onMouseOver="ShowTip(event, 'tt5', 'link131')" onMouseOut="HideTip('tt5')">chomp</a>, <a href="#text.delete" class=LFunction id=link132 onMouseOver="ShowTip(event, 'tt11', 'link132')" onMouseOut="HideTip('tt11')">delete</a>, <a href="#text.lstrip" class=LFunction id=link133 onMouseOver="ShowTip(event, 'tt27', 'link133')" onMouseOut="HideTip('tt27')">lstrip</a>, <a href="#text.rstrip" class=LFunction id=link134 onMouseOver="ShowTip(event, 'tt37', 'link134')" onMouseOut="HideTip('tt37')">rstrip</a>, <a href="#text.strip" class=LFunction id=link135 onMouseOver="ShowTip(event, 'tt42', 'link135')" onMouseOut="HideTip('tt42')">strip</a>, <a href="#text.trim" class=LFunction id=link136 onMouseOver="ShowTip(event, 'tt45', 'link136')" onMouseOut="HideTip('tt45')">trim</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="text.is_alpha"></a>is_alpha</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function bit is_alpha(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Returns 1 if all characters in the given string are alphabetic.&nbsp; Alphabetic characters are <b>[a-zA-Z]</b>.</p><h4 class=CHeading>Argument</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>s</td><td class=CDLDescription>An input string.</td></tr></table><h4 class=CHeading>Returns</h4><p>If all characters in <b>s</b> are alphabetic, 1 is returned.&nbsp; Otherwise, 0 is returned.&nbsp; If <b>s</b> is an empty string, 0 is returned.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">assert( text::is_alpha( &quot;abc&quot;  ) == 1 );
assert( text::is_alpha( &quot;abc_&quot; ) == 0 );</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#text.is_digit" class=LFunction id=link137 onMouseOver="ShowTip(event, 'tt18', 'link137')" onMouseOut="HideTip('tt18')">is_digit</a>, <a href="#text.is_lower" class=LFunction id=link138 onMouseOver="ShowTip(event, 'tt19', 'link138')" onMouseOut="HideTip('tt19')">is_lower</a>, <a href="#text.is_printable" class=LFunction id=link139 onMouseOver="ShowTip(event, 'tt20', 'link139')" onMouseOut="HideTip('tt20')">is_printable</a>, <a href="#text.is_space" class=LFunction id=link140 onMouseOver="ShowTip(event, 'tt22', 'link140')" onMouseOut="HideTip('tt22')">is_space</a>, <a href="#text.is_upper" class=LFunction id=link141 onMouseOver="ShowTip(event, 'tt23', 'link141')" onMouseOut="HideTip('tt23')">is_upper</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="text.is_digit"></a>is_digit</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function bit is_digit(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Returns 1 if all characters in the given string are digits.&nbsp; Digits are <b>[0-9]</b>.</p><h4 class=CHeading>Argument</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>s</td><td class=CDLDescription>An input string.</td></tr></table><h4 class=CHeading>Returns</h4><p>If all characters in <b>s</b> are digits, 1 is returned.&nbsp; Otherwise, 0 is returned.&nbsp;  If <b>s</b> is an empty string, 0 is returned.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">assert( text::is_digit( &quot;123&quot;  ) == 1 );
assert( text::is_digit( &quot;123X&quot; ) == 0 );</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#text.is_alpha" class=LFunction id=link142 onMouseOver="ShowTip(event, 'tt17', 'link142')" onMouseOut="HideTip('tt17')">is_alpha</a>, <a href="#text.is_lower" class=LFunction id=link143 onMouseOver="ShowTip(event, 'tt19', 'link143')" onMouseOut="HideTip('tt19')">is_lower</a>, <a href="#text.is_printable" class=LFunction id=link144 onMouseOver="ShowTip(event, 'tt20', 'link144')" onMouseOut="HideTip('tt20')">is_printable</a>, <a href="#text.is_space" class=LFunction id=link145 onMouseOver="ShowTip(event, 'tt22', 'link145')" onMouseOut="HideTip('tt22')">is_space</a>, <a href="#text.is_upper" class=LFunction id=link146 onMouseOver="ShowTip(event, 'tt23', 'link146')" onMouseOut="HideTip('tt23')">is_upper</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="text.is_lower"></a>is_lower</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function bit is_lower(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Returns 1 if all <u>cased</u> characters in the given string are lowercase.&nbsp;  Lowercase characters are <b>[a-z]</b>.</p><h4 class=CHeading>Argument</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>s</td><td class=CDLDescription>An input string.</td></tr></table><h4 class=CHeading>Returns</h4><p>If all cased characters in <b>s</b> are lowercase, 1 is returned.&nbsp; Otherwise, 0 is returned.&nbsp; If <b>s</b> is an empty string, 0 is returned.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">assert( text::is_lower( &quot;abc&quot;   ) == 1 );
assert( text::is_lower( &quot;abcX&quot;  ) == 0 );
assert( text::is_lower( &quot;abc!?&quot; ) == 1 ); // all cased characters are lowercase</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#text.is_alpha" class=LFunction id=link147 onMouseOver="ShowTip(event, 'tt17', 'link147')" onMouseOut="HideTip('tt17')">is_alpha</a>, <a href="#text.is_digit" class=LFunction id=link148 onMouseOver="ShowTip(event, 'tt18', 'link148')" onMouseOut="HideTip('tt18')">is_digit</a>, <a href="#text.is_printable" class=LFunction id=link149 onMouseOver="ShowTip(event, 'tt20', 'link149')" onMouseOut="HideTip('tt20')">is_printable</a>, <a href="#text.is_space" class=LFunction id=link150 onMouseOver="ShowTip(event, 'tt22', 'link150')" onMouseOut="HideTip('tt22')">is_space</a>, <a href="#text.is_upper" class=LFunction id=link151 onMouseOver="ShowTip(event, 'tt23', 'link151')" onMouseOut="HideTip('tt23')">is_upper</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="text.is_printable"></a>is_printable</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function bit is_printable(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Returns 1 if all characters in the given string are printable.&nbsp; Printable characters are the ones whose ASCII code are between &lsquo;h20 (&ldquo; &ldquo;) and &lsquo;h7F (&ldquo;~&rdquo;).</p><h4 class=CHeading>Argument</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>s</td><td class=CDLDescription>An input string.</td></tr></table><h4 class=CHeading>Returns</h4><p>If all characters in <b>s</b> are printable, 1 is returned.&nbsp; Otherwise, 0 is returned.&nbsp;  If <b>s</b> is an empty string, 0 is returned.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">assert( text::is_printable( &quot;!@#$&quot; ) == 1 );
assert( text::is_printable( &quot;\200&quot; ) == 0 ); // ASCII 'h80 is not printable</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#text.is_alpha" class=LFunction id=link152 onMouseOver="ShowTip(event, 'tt17', 'link152')" onMouseOut="HideTip('tt17')">is_alpha</a>, <a href="#text.is_digit" class=LFunction id=link153 onMouseOver="ShowTip(event, 'tt18', 'link153')" onMouseOut="HideTip('tt18')">is_digit</a>, <a href="#text.is_lower" class=LFunction id=link154 onMouseOver="ShowTip(event, 'tt19', 'link154')" onMouseOut="HideTip('tt19')">is_lower</a>, <a href="#text.is_space" class=LFunction id=link155 onMouseOver="ShowTip(event, 'tt22', 'link155')" onMouseOut="HideTip('tt22')">is_space</a>, <a href="#text.is_upper" class=LFunction id=link156 onMouseOver="ShowTip(event, 'tt23', 'link156')" onMouseOut="HideTip('tt23')">is_upper</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="text.is_single_bit_type"></a>is_single_bit_type</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function bit is_single_bit_type(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Returns 1 if the given string is <b>bit</b>, <b>logic</b>, or <b>reg</b>.</p><h4 class=CHeading>Argument</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>s</td><td class=CDLDescription>An input string.</td></tr></table><h4 class=CHeading>Returns</h4><p>If <b>s</b> is <b>bit</b>, <b>logic</b>, or <b>reg</b>, 1 is returned.&nbsp; Othewise, 0 is returned.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">assert( text::is_single_bit_type( &quot;bit&quot; ) == 1 );
assert( text::is_single_bit_type( &quot;int&quot; ) == 0 );</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="text.is_space"></a>is_space</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function bit is_space(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Returns 1 if all characters in the given string are whitespace characters: a space (&ldquo; &ldquo;), a tab (<b>\t</b>), or a newline (<b>\n</b>).</p><h4 class=CHeading>Argument</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>s</td><td class=CDLDescription>An input string.</td></tr></table><h4 class=CHeading>Returns</h4><p>If all characters in <b>s</b> are whitespace characters, 1 is returned.&nbsp; Otherwise, 0 is returned.&nbsp; If <b>s</b> is an empty string, 0 is returned.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">assert( text::is_space( &quot; \t\n&quot; ) == 1 );
assert( text::is_space( &quot;X\t\n&quot; ) == 0 );</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#text.is_alpha" class=LFunction id=link157 onMouseOver="ShowTip(event, 'tt17', 'link157')" onMouseOut="HideTip('tt17')">is_alpha</a>, <a href="#text.is_digit" class=LFunction id=link158 onMouseOver="ShowTip(event, 'tt18', 'link158')" onMouseOut="HideTip('tt18')">is_digit</a>, <a href="#text.is_lower" class=LFunction id=link159 onMouseOver="ShowTip(event, 'tt19', 'link159')" onMouseOut="HideTip('tt19')">is_lower</a>, <a href="#text.is_printable" class=LFunction id=link160 onMouseOver="ShowTip(event, 'tt20', 'link160')" onMouseOut="HideTip('tt20')">is_printable</a>, <a href="#text.is_upper" class=LFunction id=link161 onMouseOver="ShowTip(event, 'tt23', 'link161')" onMouseOut="HideTip('tt23')">is_upper</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="text.is_upper"></a>is_upper</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function bit is_upper(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Returns 1 if all <u>cased</u> characters in the given string are uppercase.&nbsp;  Uppercase characters are <b>[A-Z]</b>.</p><h4 class=CHeading>Argument</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>s</td><td class=CDLDescription>An input string.</td></tr></table><h4 class=CHeading>Returns</h4><p>If all cased characters in <b>s</b> are uppercase, 1 is returned.&nbsp; Otherwise, 0 is returned.&nbsp;  If <b>s</b> is an empty string, 0 is returned.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">assert( text::is_upper( &quot;ABC&quot;   ) == 1 );
assert( text::is_upper( &quot;ABCx&quot;  ) == 0 );
assert( text::is_upper( &quot;ABC!?&quot; ) == 1 ); // all cased characters are uppercase</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#text.is_alpha" class=LFunction id=link162 onMouseOver="ShowTip(event, 'tt17', 'link162')" onMouseOut="HideTip('tt17')">is_alpha</a>, <a href="#text.is_digit" class=LFunction id=link163 onMouseOver="ShowTip(event, 'tt18', 'link163')" onMouseOut="HideTip('tt18')">is_digit</a>, <a href="#text.is_lower" class=LFunction id=link164 onMouseOver="ShowTip(event, 'tt19', 'link164')" onMouseOut="HideTip('tt19')">is_lower</a>, <a href="#text.is_printable" class=LFunction id=link165 onMouseOver="ShowTip(event, 'tt20', 'link165')" onMouseOut="HideTip('tt20')">is_printable</a>, <a href="#text.is_space" class=LFunction id=link166 onMouseOver="ShowTip(event, 'tt22', 'link166')" onMouseOut="HideTip('tt22')">is_space</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="text.join_str"></a>join_str</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string join_str(</td><td class="PType  prettyprint " nowrap>string_q&nbsp;</td><td class="PParameter  prettyprint " nowrap>strings,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>separator</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> &quot;&quot;</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Returns a string by concatenating the strings in the given string queue, separated by the specified separator.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>strings</td><td class=CDLDescription>A queue of strings.&nbsp; The <b>strings</b> can be specified using an array literal.</td></tr><tr><td class=CDLEntry>separator</td><td class=CDLDescription><span class="optional">optional</span> A separator between strings.&nbsp; The default is an empty string (&ldquo;&rdquo;).</td></tr></table><h4 class=CHeading>Returns</h4><p>A string by concatenating the strings in <b>strings</b>, separated by <b>separator</b>.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">assert( text::join_str( { &quot;abc&quot;, &quot;XYZ&quot; }        ) == &quot;abcXYZ&quot;    );
assert( text::join_str( { &quot;abc&quot;, &quot;XYZ&quot; }, &quot;---&quot; ) == &quot;abc---XYZ&quot; );</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="text.lc_first"></a>lc_first</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string lc_first(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Returns a copy of the given string with the first character lowercased and the remainder unchanged.</p><h4 class=CHeading>Argument</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>s</td><td class=CDLDescription>An input string.</td></tr></table><h4 class=CHeading>Returns</h4><p>A copy of <b>s</b> with the first character lowercased and the remainder unchanged.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">assert( text::lc_first( &quot;Lower CASE first&quot; ) == &quot;lower CASE first&quot; );</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#text.capitalize" class=LFunction id=link167 onMouseOver="ShowTip(event, 'tt2', 'link167')" onMouseOut="HideTip('tt2')">capitalize</a>, <a href="#text.swap_case" class=LFunction id=link168 onMouseOver="ShowTip(event, 'tt43', 'link168')" onMouseOut="HideTip('tt43')">swap_case</a>, <a href="#text.title_case" class=LFunction id=link169 onMouseOver="ShowTip(event, 'tt44', 'link169')" onMouseOut="HideTip('tt44')">title_case</a>, <a href="#text.uc_first" class=LFunction id=link170 onMouseOver="ShowTip(event, 'tt46', 'link170')" onMouseOut="HideTip('tt46')">uc_first</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="text.ljust"></a>ljust</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string ljust(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>width,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>byte&nbsp;</td><td class="PParameter  prettyprint " nowrap>fill_char</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> &quot; &quot;,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>bit&nbsp;</td><td class="PParameter  prettyprint " nowrap>trim_right</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Returns a string of the specified width with the given string left justified and padded with the specified character.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>s</td><td class=CDLDescription>A string to left-justify.</td></tr><tr><td class=CDLEntry>width</td><td class=CDLDescription>The width of the returned string.</td></tr><tr><td class=CDLEntry>fill_char</td><td class=CDLDescription><span class="optional">optional</span> A character used for padding if <b>width</b> is wider than the length of <b>s</b>.&nbsp;  The default is a space character (&ldquo; &ldquo;).</td></tr><tr><td class=CDLEntry>trim_right</td><td class=CDLDescription><span class="optional">optional</span> If <b>width</b> is narrower than the length of <b>s</b> and <b>trim_right</b> is 1, then the tail of <b>s</b> is trimmed to fit within <b>width</b>.&nbsp; If <b>trim_right</b> is 0, then <b>width</b> is widened to the length of <b>s</b>.&nbsp;  If <b>width</b> is wider than or equal to the length of <b>s</b>, <b>trim_right</b> is ignored.&nbsp;  The default is 0.</td></tr></table><h4 class=CHeading>Returns</h4><p>A string with <b>s</b> left-justified and padded with <b>fill_char</b>.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">assert( text::ljust( &quot;ljust me&quot;, 15 )                  == &quot;ljust me       &quot; );
assert( text::ljust( &quot;ljust me&quot;, 15, &quot;-&quot; )             == &quot;ljust me-------&quot; );
assert( text::ljust( &quot;ljust me&quot;, 7 )                   == &quot;ljust me&quot;        ); // widened to fit
assert( text::ljust( &quot;ljust me&quot;, 7, .trim_right( 1 ) ) == &quot;ljust m&quot;         ); // trimmed</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#text.center" class=LFunction id=link171 onMouseOver="ShowTip(event, 'tt3', 'link171')" onMouseOut="HideTip('tt3')">center</a>, <a href="#text.rjust" class=LFunction id=link172 onMouseOver="ShowTip(event, 'tt34', 'link172')" onMouseOut="HideTip('tt34')">rjust</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="text.lstrip"></a>lstrip</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string lstrip(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>chars</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> &quot; \t\n&quot;</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Returns a copy of the given string with leading characters removed.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>s</td><td class=CDLDescription>A string to be stripped.</td></tr><tr><td class=CDLEntry>chars</td><td class=CDLDescription><span class="optional">optional</span> A string specifying the set of characters to be removed.&nbsp; The default is whitespace characters: a space (&ldquo; &ldquo;), a tab (<b>\t</b>), or a newline (<b>\n</b>).&nbsp; Note that the <b>chars</b> string is not a prefix.&nbsp; All combinations of its characters are stripped.</td></tr></table><h4 class=CHeading>Returns</h4><p>A copy of <b>s</b> with leading characters removed.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">assert( text::lstrip( &quot;      abc&quot; ) == &quot;abc&quot; );
assert( text::lstrip( &quot;  \t\nabc&quot; ) == &quot;abc&quot; );
assert( text::lstrip( &quot;aabbcc&quot;, &quot;a&quot;  ) == &quot;bbcc&quot; );
assert( text::lstrip( &quot;aabbcc&quot;, &quot;ab&quot; ) == &quot;cc&quot;   );
assert( text::lstrip( &quot;aabbcc&quot;, &quot;ba&quot; ) == &quot;cc&quot;   ); // &quot;b&quot;s and &quot;a&quot;s are stripped</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#text.chop" class=LFunction id=link173 onMouseOver="ShowTip(event, 'tt6', 'link173')" onMouseOut="HideTip('tt6')">chop</a>, <a href="#text.chomp" class=LFunction id=link174 onMouseOver="ShowTip(event, 'tt5', 'link174')" onMouseOut="HideTip('tt5')">chomp</a>, <a href="#text.delete" class=LFunction id=link175 onMouseOver="ShowTip(event, 'tt11', 'link175')" onMouseOut="HideTip('tt11')">delete</a>, <a href="#text.rstrip" class=LFunction id=link176 onMouseOver="ShowTip(event, 'tt37', 'link176')" onMouseOut="HideTip('tt37')">rstrip</a>, <a href="#text.strip" class=LFunction id=link177 onMouseOver="ShowTip(event, 'tt42', 'link177')" onMouseOut="HideTip('tt42')">strip</a>, <a href="#text.trim" class=LFunction id=link178 onMouseOver="ShowTip(event, 'tt45', 'link178')" onMouseOut="HideTip('tt45')">trim</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="text.only"></a>only</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function bit only(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>chars</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Returns 1 if the given string consists of only the specified set of characters.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>s</td><td class=CDLDescription>An input string.</td></tr><tr><td class=CDLEntry>chars</td><td class=CDLDescription>A string specifying the set of characters to be checked.&nbsp; An empty string (&ldquo;&rdquo;) matches no input string.</td></tr></table><h4 class=CHeading>Returns</h4><p>If <b>s</b> consists of only the characters in <b>chars</b>, 1 is returned.&nbsp; Othewise, 0 is returned.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">assert( text::only( &quot;abc&quot;, &quot;abcXYZ&quot; ) == 1 );
assert( text::only( &quot;abcXYZ&quot;, &quot;abc&quot; ) == 0 );</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#text.contains" class=LFunction id=link179 onMouseOver="ShowTip(event, 'tt8', 'link179')" onMouseOut="HideTip('tt8')">contains</a>, <a href="#text.contains_str" class=LFunction id=link180 onMouseOver="ShowTip(event, 'tt9', 'link180')" onMouseOut="HideTip('tt9')">contains_str</a>, <a href="#text.count" class=LFunction id=link181 onMouseOver="ShowTip(event, 'tt10', 'link181')" onMouseOut="HideTip('tt10')">count</a>, <a href="#text.ends_with" class=LFunction id=link182 onMouseOver="ShowTip(event, 'tt12', 'link182')" onMouseOut="HideTip('tt12')">ends_with</a>, <a href="#text.find_any" class=LFunction id=link183 onMouseOver="ShowTip(event, 'tt13', 'link183')" onMouseOut="HideTip('tt13')">find_any</a>, <a href="#text.index" class=LFunction id=link184 onMouseOver="ShowTip(event, 'tt15', 'link184')" onMouseOut="HideTip('tt15')">index</a>, <a href="#text.rfind_any" class=LFunction id=link185 onMouseOver="ShowTip(event, 'tt32', 'link185')" onMouseOut="HideTip('tt32')">rfind_any</a>, <a href="#text.rindex" class=LFunction id=link186 onMouseOver="ShowTip(event, 'tt33', 'link186')" onMouseOut="HideTip('tt33')">rindex</a>, <a href="#text.starts_with" class=LFunction id=link187 onMouseOver="ShowTip(event, 'tt41', 'link187')" onMouseOut="HideTip('tt41')">starts_with</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="text.partition"></a>partition</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function three_strings partition(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>sep</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Searches the first occurrence of the specified separator in the given string and returns an array of three strings.&nbsp; The returned array consists of: the string before the separator, the separator itself, and the string after the separator.&nbsp; If the separator is not found, the given string and two empty strings are returned.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>s</td><td class=CDLDescription>An input string.</td></tr><tr><td class=CDLEntry>sep</td><td class=CDLDescription>A separator.</td></tr></table><h4 class=CHeading>Returns</h4><p>An array that consists of the part before <b>sep</b>, the <b>sep</b>, and the part after <b>sep</b>.&nbsp; If <b>sep</b> is not found, returns <b>s</b> and two empty strings.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">three_strings s, t1, t2, t3, t4;

s = '{ &quot;abc&quot;, &quot;-&quot;, &quot;XYZ&quot; };
assert( text::partition( &quot;abc-XYZ&quot;, &quot;-&quot; ) == s );

t1 = '{ &quot;&quot;, &quot;a&quot;, &quot;bcabc&quot; };
t2 = '{ &quot;a&quot;, &quot;b&quot;, &quot;cabc&quot; };
t3 = '{ &quot;ab&quot;, &quot;c&quot;, &quot;abc&quot; };
t4 = '{ &quot;abcabc&quot;, &quot;&quot;, &quot;&quot; };
assert( text::partition( &quot;abcabc&quot;, &quot;a&quot; ) == t1 );
assert( text::partition( &quot;abcabc&quot;, &quot;b&quot; ) == t2 );
assert( text::partition( &quot;abcabc&quot;, &quot;c&quot; ) == t3 );
assert( text::partition( &quot;abcabc&quot;, &quot;X&quot; ) == t4 );</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#text.rpartition" class=LFunction id=link188 onMouseOver="ShowTip(event, 'tt35', 'link188')" onMouseOut="HideTip('tt35')">rpartition</a>, <a href="#text.rsplit" class=LFunction id=link189 onMouseOver="ShowTip(event, 'tt36', 'link189')" onMouseOut="HideTip('tt36')">rsplit</a>, <a href="#text.split" class=LFunction id=link190 onMouseOver="ShowTip(event, 'tt40', 'link190')" onMouseOut="HideTip('tt40')">split</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="text.replace"></a>replace</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string replace(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>old_str,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>new_str,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>count</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> -1</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Returns a copy of the given string with the specified string replaced with a new string.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>s</td><td class=CDLDescription>An input string.</td></tr><tr><td class=CDLEntry>old_str</td><td class=CDLDescription>An old string.&nbsp; An empty string (&ldquo;&rdquo;) matches no input string.</td></tr><tr><td class=CDLEntry>new_str</td><td class=CDLDescription>A new string.</td></tr><tr><td class=CDLEntry>count</td><td class=CDLDescription><span class="optional">optional</span> The number of strings to replace.&nbsp; If specified, only the first <b>count</b> occurrences are replaced.&nbsp; By default, all occurrences are replaced.</td></tr></table><h4 class=CHeading>Returns</h4><p>A copy of <b>s</b> with the first <b>count</b> occurrences of <b>old_str</b> replaced with <b>new_str</b>.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">assert( text::replace( &quot;abcabc&quot;, &quot;abc&quot;, &quot;XYZ&quot;    ) == &quot;XYZXYZ&quot; );
assert( text::replace( &quot;abcabc&quot;, &quot;abc&quot;, &quot;XYZ&quot;, 1 ) == &quot;XYZabc&quot; );</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#text.change" class=LFunction id=link191 onMouseOver="ShowTip(event, 'tt4', 'link191')" onMouseOut="HideTip('tt4')">change</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="text.reverse"></a>reverse</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string reverse(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Returns a copy of the given string with the characters in reverse order.</p><h4 class=CHeading>Argument</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>s</td><td class=CDLDescription>An input string.</td></tr></table><h4 class=CHeading>Returns</h4><p>A copy of <b>s</b> with the characters in reverse order.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">assert( text::reverse( &quot;reverse me!&quot; ) == &quot;!em esrever&quot; );
assert( text::reverse( &quot;wonton? not now&quot; ) == &quot;won ton ?notnow&quot; );</pre></blockquote></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="text.rfind_any"></a>rfind_any</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function int rfind_any(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>string_q&nbsp;</td><td class="PParameter  prettyprint " nowrap>subs,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>start_pos</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>end_pos</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> -1</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Returns the highest index in the given string where each specified substring is found.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>s</td><td class=CDLDescription>An input string.</td></tr><tr><td class=CDLEntry>subs</td><td class=CDLDescription>A queue of substrings.&nbsp; The substrings can be specified using an array literal.&nbsp; An empty substring (&ldquo;&rdquo;) matches no input string.</td></tr><tr><td class=CDLEntry>start_pos</td><td class=CDLDescription><span class="optional">optional</span> Specifies the position in <b>s</b> to begin the search.&nbsp; See <a href="#text.Common_Arguments" class=LGroup >Common Arguments</a>.</td></tr><tr><td class=CDLEntry>end_pos</td><td class=CDLDescription><span class="optional">optional</span> Specifies the position in <b>s</b> to end the search.&nbsp; See <a href="#text.Common_Arguments" class=LGroup >Common Arguments</a>.</td></tr></table><h4 class=CHeading>Returns</h4><p>The highest index in <b>s</b> where each substring in <b>subs</b> is found.&nbsp; If no substring is found, -1 is returned.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">assert( text::rfind_any( &quot;a primary library&quot;, { &quot;primary&quot;, &quot;library&quot; } )                  == 10 );
assert( text::rfind_any( &quot;a primary library&quot;, { &quot;primary&quot;, &quot;library&quot; }, .start_pos( 3 ) ) == 10 );
//                           |-----------&gt;|
//                           3
assert( text::rfind_any( &quot;a primary library&quot;, { &quot;primary&quot;, &quot;library&quot; }, .end_pos(  7 ) )  == -1 );
//                        |-----&gt;|
//                               7
assert( text::rfind_any( &quot;a primary library&quot;, { &quot;primary&quot;, &quot;library&quot; }, .end_pos( -9 ) )  ==  2 );
//                        |------&gt;|
//                               -9</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#text.contains" class=LFunction id=link192 onMouseOver="ShowTip(event, 'tt8', 'link192')" onMouseOut="HideTip('tt8')">contains</a>, <a href="#text.contains_str" class=LFunction id=link193 onMouseOver="ShowTip(event, 'tt9', 'link193')" onMouseOut="HideTip('tt9')">contains_str</a>, <a href="#text.count" class=LFunction id=link194 onMouseOver="ShowTip(event, 'tt10', 'link194')" onMouseOut="HideTip('tt10')">count</a>, <a href="#text.ends_with" class=LFunction id=link195 onMouseOver="ShowTip(event, 'tt12', 'link195')" onMouseOut="HideTip('tt12')">ends_with</a>, <a href="#text.find_any" class=LFunction id=link196 onMouseOver="ShowTip(event, 'tt13', 'link196')" onMouseOut="HideTip('tt13')">find_any</a>, <a href="#text.index" class=LFunction id=link197 onMouseOver="ShowTip(event, 'tt15', 'link197')" onMouseOut="HideTip('tt15')">index</a>, <a href="#text.only" class=LFunction id=link198 onMouseOver="ShowTip(event, 'tt28', 'link198')" onMouseOut="HideTip('tt28')">only</a>, <a href="#text.rindex" class=LFunction id=link199 onMouseOver="ShowTip(event, 'tt33', 'link199')" onMouseOut="HideTip('tt33')">rindex</a>, <a href="#text.starts_with" class=LFunction id=link200 onMouseOver="ShowTip(event, 'tt41', 'link200')" onMouseOut="HideTip('tt41')">starts_with</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="text.rindex"></a>rindex</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function int rindex(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>sub,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>start_pos</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>end_pos</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> -1</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Returns the index of the last occurrence of the specified substring in the given string within the optionally specified range.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>s</td><td class=CDLDescription>An input string.</td></tr><tr><td class=CDLEntry>sub</td><td class=CDLDescription>A substring to search.&nbsp; An empty substring (&ldquo;&rdquo;) matches no input string.</td></tr><tr><td class=CDLEntry>start_pos</td><td class=CDLDescription><span class="optional">optional</span> Specifies the position in <b>s</b> to begin the search.&nbsp; See <a href="#text.Common_Arguments" class=LGroup >Common Arguments</a>.</td></tr><tr><td class=CDLEntry>end_pos</td><td class=CDLDescription><span class="optional">optional</span> Specifies the position in <b>s</b> to end the search.&nbsp; See <a href="#text.Common_Arguments" class=LGroup >Common Arguments</a>.</td></tr></table><h4 class=CHeading>Returns</h4><p>The index of the last occurrence of <b>sub</b> in <b>s</b>.&nbsp; If <b>sub</b> is not found, -1 is returned.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">assert( text::rindex( &quot;a primary library&quot;, &quot;ary&quot; )                  == 14 );
assert( text::rindex( &quot;a primary library&quot;, &quot;ary&quot;, .start_pos( 3 ) ) == 14 );
//                        |-----------&gt;|
//                        3
assert( text::rindex( &quot;a primary library&quot;, &quot;ary&quot;, .end_pos(  7 ) )  == -1 );
//                     |-----&gt;|
//                            7
assert( text::rindex( &quot;a primary library&quot;, &quot;ary&quot;, .end_pos( -9 ) )  ==  6 );
//                     |------&gt;|
//                            -9</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#text.contains" class=LFunction id=link201 onMouseOver="ShowTip(event, 'tt8', 'link201')" onMouseOut="HideTip('tt8')">contains</a>, <a href="#text.contains_str" class=LFunction id=link202 onMouseOver="ShowTip(event, 'tt9', 'link202')" onMouseOut="HideTip('tt9')">contains_str</a>, <a href="#text.count" class=LFunction id=link203 onMouseOver="ShowTip(event, 'tt10', 'link203')" onMouseOut="HideTip('tt10')">count</a>, <a href="#text.ends_with" class=LFunction id=link204 onMouseOver="ShowTip(event, 'tt12', 'link204')" onMouseOut="HideTip('tt12')">ends_with</a>, <a href="#text.find_any" class=LFunction id=link205 onMouseOver="ShowTip(event, 'tt13', 'link205')" onMouseOut="HideTip('tt13')">find_any</a>, <a href="#text.index" class=LFunction id=link206 onMouseOver="ShowTip(event, 'tt15', 'link206')" onMouseOut="HideTip('tt15')">index</a>, <a href="#text.only" class=LFunction id=link207 onMouseOver="ShowTip(event, 'tt28', 'link207')" onMouseOut="HideTip('tt28')">only</a>, <a href="#text.rfind_any" class=LFunction id=link208 onMouseOver="ShowTip(event, 'tt32', 'link208')" onMouseOut="HideTip('tt32')">rfind_any</a>, <a href="#text.starts_with" class=LFunction id=link209 onMouseOver="ShowTip(event, 'tt41', 'link209')" onMouseOut="HideTip('tt41')">starts_with</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="text.rjust"></a>rjust</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string rjust(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>width,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>byte&nbsp;</td><td class="PParameter  prettyprint " nowrap>fill_char</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> &quot; &quot;,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>bit&nbsp;</td><td class="PParameter  prettyprint " nowrap>trim_left</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Returns a string of the specified width with the given string right justified and padded with the specified character.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>s</td><td class=CDLDescription>A string to right-justify.</td></tr><tr><td class=CDLEntry>width</td><td class=CDLDescription>The width of the returned string.</td></tr><tr><td class=CDLEntry>fill_char</td><td class=CDLDescription><span class="optional">optional</span> A character used for padding if <b>width</b> is wider than the length of <b>s</b>.&nbsp;  The default is a space character (&ldquo; &ldquo;).</td></tr><tr><td class=CDLEntry>trim_left</td><td class=CDLDescription><span class="optional">optional</span> If <b>width</b> is narrower than the length of <b>s</b> and <b>trim_left</b> is 1, then the head of <b>s</b> is trimmed to fit within <b>width</b>.&nbsp; If <b>trim_left</b> is 0, then <b>width</b> is widened to the length of <b>s</b>.&nbsp;  If <b>width</b> is wider than or equal to the length of <b>s</b>, <b>trim_left</b> is ignored.&nbsp;  The default is 0.</td></tr></table><h4 class=CHeading>Returns</h4><p>A string with <b>s</b> right justified and padded with <b>fill_char</b>.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">assert( text::rjust( &quot;rjust me&quot;, 15 )                 == &quot;       rjust me&quot; );
assert( text::rjust( &quot;rjust me&quot;, 15, &quot;-&quot; )            == &quot;-------rjust me&quot; );
assert( text::rjust( &quot;rjust me&quot;, 7 )                  ==        &quot;rjust me&quot; ); // widened to fit
assert( text::rjust( &quot;rjust me&quot;, 7, .trim_left( 1 ) ) ==         &quot;just me&quot; ); // trimmed</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#text.center" class=LFunction id=link210 onMouseOver="ShowTip(event, 'tt3', 'link210')" onMouseOut="HideTip('tt3')">center</a>, <a href="#text.ljust" class=LFunction id=link211 onMouseOver="ShowTip(event, 'tt26', 'link211')" onMouseOut="HideTip('tt26')">ljust</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="text.rpartition"></a>rpartition</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function three_strings rpartition(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>sep</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Searches the last occurrence of the specified separator in the given string and returns an array of three strings.&nbsp; The returned array consists of: the string before the separator, the separator itself, and the string after the separator.&nbsp; If the separator is not found, the given string and two empty strings are returned.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>s</td><td class=CDLDescription>An input string.</td></tr><tr><td class=CDLEntry>sep</td><td class=CDLDescription>A separator.</td></tr></table><h4 class=CHeading>Returns</h4><p>An array that consists of the part before <b>sep</b>, the <b>sep</b>, and the part after <b>sep</b>.&nbsp; If <b>sep</b> is not found, returns <b>s</b> and two empty strings.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">three_strings s, t1, t2, t3, t4;

s = '{ &quot;abc&quot;, &quot;-&quot;, &quot;XYZ&quot; };
assert( text::rpartition( &quot;abc-XYZ&quot;, &quot;-&quot; ) == s );

t1 = '{ &quot;abc&quot;, &quot;a&quot;, &quot;bc&quot; };
t2 = '{ &quot;abca&quot;, &quot;b&quot;, &quot;c&quot; };
t3 = '{ &quot;abcab&quot;, &quot;c&quot;, &quot;&quot; };
t4 = '{ &quot;abcabc&quot;, &quot;&quot;, &quot;&quot; };
assert( text::rpartition( &quot;abcabc&quot;, &quot;a&quot; ) == t1 );
assert( text::rpartition( &quot;abcabc&quot;, &quot;b&quot; ) == t2 );
assert( text::rpartition( &quot;abcabc&quot;, &quot;c&quot; ) == t3 );
assert( text::rpartition( &quot;abcabc&quot;, &quot;X&quot; ) == t4 );</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#text.partition" class=LFunction id=link212 onMouseOver="ShowTip(event, 'tt29', 'link212')" onMouseOut="HideTip('tt29')">partition</a>, <a href="#text.rsplit" class=LFunction id=link213 onMouseOver="ShowTip(event, 'tt36', 'link213')" onMouseOut="HideTip('tt36')">rsplit</a>, <a href="#text.split" class=LFunction id=link214 onMouseOver="ShowTip(event, 'tt40', 'link214')" onMouseOut="HideTip('tt40')">split</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="text.rsplit"></a>rsplit</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string_q rsplit(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>sep</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> &quot;&quot;,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>max_split</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> -1</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Returns a queue of substrings by dividing the given string by the specified separator from the right.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>s</td><td class=CDLDescription>An input string.&nbsp; If <b>s</b> is empty, an empty queue is returned.</td></tr><tr><td class=CDLEntry>sep</td><td class=CDLDescription><span class="optional">optional</span> A separator.&nbsp; If specified, <b>sep</b> is used as the delimiter.&nbsp; The <b>sep</b> itself is not returned as an element of the queue.&nbsp; If not specified, whitespace characters (a space (&ldquo; &ldquo;), a tab (<b>\t</b>), or a newline (<b>\n</b>)) are used.&nbsp; If <b>sep</b> is not specified, the contiguous whitespaces and the trailing whitespaces are ignored.</td></tr><tr><td class=CDLEntry>max_split</td><td class=CDLDescription><span class="optional">optional</span> If specified, at most <b>max_split</b> splits are done from the right and the remaining substring is returned as the first element of the queue.&nbsp;  If not specified or -1, there is no limit to the number of splits.</td></tr></table><h4 class=CHeading>Returns</h4><p>A queue of substrings (<a href="cl_types-svh.html#string_q" class=LType id=link215 onMouseOver="ShowTip(event, 'tt50', 'link215')" onMouseOut="HideTip('tt50')">string_q</a>).</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">string_q s1, s2, s3, s4, t1, t2, t3, t4, t5;

s1 = '{ &quot;abc&quot;, &quot;pqr&quot;, &quot;xyz&quot; };
s2 = '{ &quot;  abc  pqr&quot;, &quot;xyz&quot; };
s3 = '{ &quot;  abc&quot;, &quot;pqr&quot;, &quot;xyz&quot; };
s4 = '{ &quot;abc&quot;, &quot;pqr&quot;, &quot;xyz&quot; };
assert( text::rsplit( &quot;  abc  pqr  xyz  &quot;                  ) == s1 );
assert( text::rsplit( &quot;  abc  pqr  xyz  &quot;, .max_split( 1 ) ) == s2 );
assert( text::rsplit( &quot;  abc  pqr  xyz  &quot;, .max_split( 2 ) ) == s3 );
assert( text::rsplit( &quot;  abc  pqr  xyz  &quot;, .max_split( 3 ) ) == s4 );

t1 = '{ &quot;&quot;, &quot;abc&quot;, &quot;pqr&quot;, &quot;xyz&quot;, &quot;&quot; };
t2 = '{ &quot;--abc--pqr--xyz&quot;, &quot;&quot; };
t3 = '{ &quot;--abc--pqr&quot;, &quot;xyz&quot;, &quot;&quot; };
t4 = '{ &quot;--abc&quot;, &quot;pqr&quot;, &quot;xyz&quot;, &quot;&quot; };
t5 = '{ &quot;&quot;, &quot;abc&quot;, &quot;pqr&quot;, &quot;xyz&quot;, &quot;&quot; };
assert( text::rsplit( &quot;--abc--pqr--xyz--&quot;, &quot;--&quot;                  ) == t1 );
assert( text::rsplit( &quot;--abc--pqr--xyz--&quot;, &quot;--&quot;, .max_split( 1 ) ) == t2 );
assert( text::rsplit( &quot;--abc--pqr--xyz--&quot;, &quot;--&quot;, .max_split( 2 ) ) == t3 );
assert( text::rsplit( &quot;--abc--pqr--xyz--&quot;, &quot;--&quot;, .max_split( 3 ) ) == t4 );
assert( text::rsplit( &quot;--abc--pqr--xyz--&quot;, &quot;--&quot;, .max_split( 4 ) ) == t5 );</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#text.partition" class=LFunction id=link216 onMouseOver="ShowTip(event, 'tt29', 'link216')" onMouseOut="HideTip('tt29')">partition</a>, <a href="#text.rpartition" class=LFunction id=link217 onMouseOver="ShowTip(event, 'tt35', 'link217')" onMouseOut="HideTip('tt35')">rpartition</a>, <a href="#text.split" class=LFunction id=link218 onMouseOver="ShowTip(event, 'tt40', 'link218')" onMouseOut="HideTip('tt40')">split</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="text.rstrip"></a>rstrip</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string rstrip(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>chars</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> &quot; \t\n&quot;</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Returns a copy of the given string with trailing characters removed.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>s</td><td class=CDLDescription>A string to be stripped.</td></tr><tr><td class=CDLEntry>chars</td><td class=CDLDescription><span class="optional">optional</span> A string specifying the set of characters to be removed.&nbsp; The default is whitespace characters: a space (&ldquo; &ldquo;), a tab (<b>\t</b>), or a newline (<b>\n</b>).&nbsp; Note that the <b>chars</b> string is not a suffix.&nbsp; All combinations of its characters are stripped.</td></tr></table><h4 class=CHeading>Returns</h4><p>A copy of <b>s</b> with trailing characters removed.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">assert( text::rstrip( &quot;abc      &quot; ) == &quot;abc&quot; );
assert( text::rstrip( &quot;abc  \t\n&quot; ) == &quot;abc&quot; );
assert( text::rstrip( &quot;aabbcc&quot;, &quot;c&quot;  ) == &quot;aabb&quot; );
assert( text::rstrip( &quot;aabbcc&quot;, &quot;bc&quot; ) == &quot;aa&quot;   );
assert( text::rstrip( &quot;aabbcc&quot;, &quot;cb&quot; ) == &quot;aa&quot;   ); // &quot;c&quot;s and &quot;b&quot;s are stripped</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#text.chop" class=LFunction id=link219 onMouseOver="ShowTip(event, 'tt6', 'link219')" onMouseOut="HideTip('tt6')">chop</a>, <a href="#text.chomp" class=LFunction id=link220 onMouseOver="ShowTip(event, 'tt5', 'link220')" onMouseOut="HideTip('tt5')">chomp</a>, <a href="#text.delete" class=LFunction id=link221 onMouseOver="ShowTip(event, 'tt11', 'link221')" onMouseOut="HideTip('tt11')">delete</a>, <a href="#text.lstrip" class=LFunction id=link222 onMouseOver="ShowTip(event, 'tt27', 'link222')" onMouseOut="HideTip('tt27')">lstrip</a>, <a href="#text.strip" class=LFunction id=link223 onMouseOver="ShowTip(event, 'tt42', 'link223')" onMouseOut="HideTip('tt42')">strip</a>, <a href="#text.trim" class=LFunction id=link224 onMouseOver="ShowTip(event, 'tt45', 'link224')" onMouseOut="HideTip('tt45')">trim</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="text.slice"></a>slice</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string slice(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>start_pos</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>end_pos</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> - 1</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Returns a substring in the specified range.&nbsp; This function is similar to the <b>substr</b> function in native SystemVerilog, but one can specify negative numbers to specify the range with this function.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>s</td><td class=CDLDescription>An input string.</td></tr><tr><td class=CDLEntry>start_pos</td><td class=CDLDescription><span class="optional">optional</span> Specifies the position in <b>s</b> to begin the substring.&nbsp; See <a href="#text.Common_Arguments" class=LGroup >Common Arguments</a>.</td></tr><tr><td class=CDLEntry>end_pos</td><td class=CDLDescription><span class="optional">optional</span> Specifies the position in <b>s</b> to end the substring.&nbsp; See <a href="#text.Common_Arguments" class=LGroup >Common Arguments</a>.</td></tr></table><h4 class=CHeading>Returns</h4><p>Returns a substring in the specified range.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">assert( text::slice( &quot;slice me&quot;,  2,  6 ) == &quot;ice m&quot; );
assert( text::slice( &quot;slice me&quot;, -6, -2 ) == &quot;ice m&quot; );</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#text.slice_len" class=LFunction id=link225 onMouseOver="ShowTip(event, 'tt39', 'link225')" onMouseOut="HideTip('tt39')">slice_len</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="text.slice_len"></a>slice_len</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string slice_len(</td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>start_pos</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0,</td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap>int&nbsp;</td><td class="PType  prettyprint " nowrap>unsigned&nbsp;</td><td class="PParameter  prettyprint " nowrap>length</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> s.len()</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Returns a substring in the specified range.&nbsp; Unlike <a href="#text.slice" class=LFunction id=link226 onMouseOver="ShowTip(event, 'tt38', 'link226')" onMouseOut="HideTip('tt38')">slice</a>, this function takes the length to extract instead of the end position.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>s</td><td class=CDLDescription>An input string.</td></tr><tr><td class=CDLEntry>start_pos</td><td class=CDLDescription><span class="optional">optional</span> Specifies the position in <b>s</b> to begin the substring.&nbsp; See <a href="#text.Common_Arguments" class=LGroup >Common Arguments</a>.</td></tr><tr><td class=CDLEntry>length</td><td class=CDLDescription><span class="optional">optional</span> The number of characters to extract.&nbsp; The default is the length of <b>s</b>.</td></tr></table><h4 class=CHeading>Returns</h4><p>Returns a substring in the specified range.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">assert( text::slice_len( &quot;slice me&quot;,  2, 5 ) == &quot;ice m&quot; );
assert( text::slice_len( &quot;slice me&quot;, -6, 5 ) == &quot;ice m&quot; );</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#text.slice" class=LFunction id=link227 onMouseOver="ShowTip(event, 'tt38', 'link227')" onMouseOut="HideTip('tt38')">slice</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="text.split"></a>split</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string_q split(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>sep</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> &quot;&quot;,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>max_split</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> -1</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Returns a queue of substrings by dividing the given string by the specified separator.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>s</td><td class=CDLDescription>An input string.&nbsp; If <b>s</b> is empty, an empty queue is returned.</td></tr><tr><td class=CDLEntry>sep</td><td class=CDLDescription><span class="optional">optional</span> A separator.&nbsp; If specified, <b>sep</b> is used as the delimiter.&nbsp; The <b>sep</b> itself is not returned as an element of the queue.&nbsp; If not specified, whitespace characters (a space (&ldquo; &ldquo;), a tab (<b>\t</b>), or a newline (<b>\n</b>)) are used.&nbsp; If <b>sep</b> is not specified, the leading whitespaces and the contiguous whitespaces are ignored.</td></tr><tr><td class=CDLEntry>max_split</td><td class=CDLDescription><span class="optional">optional</span> If specified, at most <b>max_split</b> splits are done and the remaining substring is returned as the last element of the queue.&nbsp;  If not specified or -1, there is no limit to the number of splits.</td></tr></table><h4 class=CHeading>Returns</h4><p>A queue of substrings (<a href="cl_types-svh.html#string_q" class=LType id=link228 onMouseOver="ShowTip(event, 'tt50', 'link228')" onMouseOut="HideTip('tt50')">string_q</a>).</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">string_q s1, s2, s3, s4, t1, t2, t3, t4, t5;

s1 = '{ &quot;abc&quot;, &quot;pqr&quot;, &quot;xyz&quot; };
s2 = '{ &quot;abc&quot;, &quot;pqr  xyz  &quot; };
s3 = '{ &quot;abc&quot;, &quot;pqr&quot;, &quot;xyz  &quot; };
s4 = '{ &quot;abc&quot;, &quot;pqr&quot;, &quot;xyz&quot; };
assert( text::split( &quot;  abc  pqr  xyz  &quot;                  ) == s1 );
assert( text::split( &quot;  abc  pqr  xyz  &quot;, .max_split( 1 ) ) == s2 );
assert( text::split( &quot;  abc  pqr  xyz  &quot;, .max_split( 2 ) ) == s3 );
assert( text::split( &quot;  abc  pqr  xyz  &quot;, .max_split( 3 ) ) == s4 );

t1 = '{ &quot;&quot;, &quot;abc&quot;, &quot;pqr&quot;, &quot;xyz&quot;, &quot;&quot; };
t2 = '{ &quot;&quot;, &quot;abc--pqr--xyz--&quot; };
t3 = '{ &quot;&quot;, &quot;abc&quot;, &quot;pqr--xyz--&quot; };
t4 = '{ &quot;&quot;, &quot;abc&quot;, &quot;pqr&quot;, &quot;xyz--&quot; };
t5 = '{ &quot;&quot;, &quot;abc&quot;, &quot;pqr&quot;, &quot;xyz&quot;, &quot;&quot; };
assert( text::split( &quot;--abc--pqr--xyz--&quot;, &quot;--&quot;                  ) == t1 );
assert( text::split( &quot;--abc--pqr--xyz--&quot;, &quot;--&quot;, .max_split( 1 ) ) == t2 );
assert( text::split( &quot;--abc--pqr--xyz--&quot;, &quot;--&quot;, .max_split( 2 ) ) == t3 );
assert( text::split( &quot;--abc--pqr--xyz--&quot;, &quot;--&quot;, .max_split( 3 ) ) == t4 );
assert( text::split( &quot;--abc--pqr--xyz--&quot;, &quot;--&quot;, .max_split( 4 ) ) == t5 );</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#text.partition" class=LFunction id=link229 onMouseOver="ShowTip(event, 'tt29', 'link229')" onMouseOut="HideTip('tt29')">partition</a>, <a href="#text.rpartition" class=LFunction id=link230 onMouseOver="ShowTip(event, 'tt35', 'link230')" onMouseOut="HideTip('tt35')">rpartition</a>, <a href="#text.rsplit" class=LFunction id=link231 onMouseOver="ShowTip(event, 'tt36', 'link231')" onMouseOut="HideTip('tt36')">rsplit</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="text.starts_with"></a>starts_with</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function bit starts_with(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>string_q&nbsp;</td><td class="PParameter  prettyprint " nowrap>prefixes,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>start_pos</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>end_pos</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> -1</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Returns 1 if the given string starts with one of the specified prefixes.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>s</td><td class=CDLDescription>An input string.</td></tr><tr><td class=CDLEntry>prefixes</td><td class=CDLDescription>A queue of prefix strings.&nbsp; The prefixes can be specified using an array literal.&nbsp;  An empty string (&ldquo;&rdquo;) matches no input string.</td></tr><tr><td class=CDLEntry>start_pos</td><td class=CDLDescription><span class="optional">optional</span> Specifies the position in <b>s</b> to begin the search.&nbsp; See <a href="#text.Common_Arguments" class=LGroup >Common Arguments</a>.</td></tr><tr><td class=CDLEntry>end_pos</td><td class=CDLDescription><span class="optional">optional</span> Specifies the position in <b>s</b> to end the search.&nbsp; See <a href="#text.Common_Arguments" class=LGroup >Common Arguments</a>.</td></tr></table><h4 class=CHeading>Returns</h4><p>If <b>s</b> starts with one of the specified <b>prefixes</b>, 1 is returned.&nbsp; Otherwise, 0 is returned.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">assert( text::starts_with( &quot;a primary library&quot;, { &quot;a primary&quot;, &quot;library&quot; } )                   == 1 );
assert( text::starts_with( &quot;a primary library&quot;, { &quot;a primary&quot;, &quot;library&quot; }, .start_pos( 10 ) ) == 1 );
//                                    |----&gt;|
//                                   10
assert( text::starts_with( &quot;a primary library&quot;, { &quot;a primary&quot;, &quot;library&quot; }, .end_pos(  7 ) )  == 0 );
//                          |-----&gt;|
//                                 7
assert( text::starts_with( &quot;a primary library&quot;, { &quot;a primary&quot;, &quot;library&quot; }, .end_pos( -9 ) )  == 1 );
//                          |------&gt;|
//                                 -9</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#text.contains" class=LFunction id=link232 onMouseOver="ShowTip(event, 'tt8', 'link232')" onMouseOut="HideTip('tt8')">contains</a>, <a href="#text.contains_str" class=LFunction id=link233 onMouseOver="ShowTip(event, 'tt9', 'link233')" onMouseOut="HideTip('tt9')">contains_str</a>, <a href="#text.count" class=LFunction id=link234 onMouseOver="ShowTip(event, 'tt10', 'link234')" onMouseOut="HideTip('tt10')">count</a>, <a href="#text.ends_with" class=LFunction id=link235 onMouseOver="ShowTip(event, 'tt12', 'link235')" onMouseOut="HideTip('tt12')">ends_with</a>, <a href="#text.find_any" class=LFunction id=link236 onMouseOver="ShowTip(event, 'tt13', 'link236')" onMouseOut="HideTip('tt13')">find_any</a>, <a href="#text.index" class=LFunction id=link237 onMouseOver="ShowTip(event, 'tt15', 'link237')" onMouseOut="HideTip('tt15')">index</a>, <a href="#text.only" class=LFunction id=link238 onMouseOver="ShowTip(event, 'tt28', 'link238')" onMouseOut="HideTip('tt28')">only</a>, <a href="#text.rfind_any" class=LFunction id=link239 onMouseOver="ShowTip(event, 'tt32', 'link239')" onMouseOut="HideTip('tt32')">rfind_any</a>, <a href="#text.rindex" class=LFunction id=link240 onMouseOver="ShowTip(event, 'tt33', 'link240')" onMouseOut="HideTip('tt33')">rindex</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="text.strip"></a>strip</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string strip(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>chars</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> &quot; \t\n&quot;</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Returns a copy of the given string with leading and trailing characters removed.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>s</td><td class=CDLDescription>A string to be stripped.</td></tr><tr><td class=CDLEntry>chars</td><td class=CDLDescription><span class="optional">optional</span> A string specifying the set of characters to be removed.&nbsp; The default is whitespace characters: a space (&ldquo; &ldquo;), a tab (<b>\t</b>), or a newline (<b>\n</b>).&nbsp; Note that the <b>chars</b> string is not a prefix or suffix.&nbsp; All combinations of its characters are stripped.</td></tr></table><h4 class=CHeading>Returns</h4><p>A copy of <b>s</b> with leading and trailing characters removed.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">assert( text::strip( &quot;   abc    &quot; ) == &quot;abc&quot; );
assert( text::strip( &quot; \t\nabc\n&quot; ) == &quot;abc&quot; );
assert( text::strip( &quot;aabbcc&quot;, &quot;a&quot;  ) == &quot;bbcc&quot; );
assert( text::strip( &quot;aabbcc&quot;, &quot;ab&quot; ) == &quot;cc&quot;   );
assert( text::strip( &quot;aabbcc&quot;, &quot;ac&quot; ) == &quot;bb&quot;   );</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#text.chop" class=LFunction id=link241 onMouseOver="ShowTip(event, 'tt6', 'link241')" onMouseOut="HideTip('tt6')">chop</a>, <a href="#text.chomp" class=LFunction id=link242 onMouseOver="ShowTip(event, 'tt5', 'link242')" onMouseOut="HideTip('tt5')">chomp</a>, <a href="#text.delete" class=LFunction id=link243 onMouseOver="ShowTip(event, 'tt11', 'link243')" onMouseOut="HideTip('tt11')">delete</a>, <a href="#text.lstrip" class=LFunction id=link244 onMouseOver="ShowTip(event, 'tt27', 'link244')" onMouseOut="HideTip('tt27')">lstrip</a>, <a href="#text.rstrip" class=LFunction id=link245 onMouseOver="ShowTip(event, 'tt37', 'link245')" onMouseOut="HideTip('tt37')">rstrip</a>, <a href="#text.trim" class=LFunction id=link246 onMouseOver="ShowTip(event, 'tt45', 'link246')" onMouseOut="HideTip('tt45')">trim</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="text.swap_case"></a>swap_case</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string swap_case(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Returns a copy of the given string with uppercase characters converted to lowercase, and lowercase characters converted to uppercase.</p><h4 class=CHeading>Argument</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>s</td><td class=CDLDescription>A string to be swap-cased.</td></tr></table><h4 class=CHeading>Returns</h4><p>A copy of <b>s</b> with uppercase characters converted to lowercase, and lowercase characters converted to uppercase.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">assert( text::swap_case( &quot;Swap Case Me!&quot; ) == &quot;sWAP cASE mE!&quot; );</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#text.capitalize" class=LFunction id=link247 onMouseOver="ShowTip(event, 'tt2', 'link247')" onMouseOut="HideTip('tt2')">capitalize</a>, <a href="#text.lc_first" class=LFunction id=link248 onMouseOver="ShowTip(event, 'tt25', 'link248')" onMouseOut="HideTip('tt25')">lc_first</a>, <a href="#text.title_case" class=LFunction id=link249 onMouseOver="ShowTip(event, 'tt44', 'link249')" onMouseOut="HideTip('tt44')">title_case</a>, <a href="#text.uc_first" class=LFunction id=link250 onMouseOver="ShowTip(event, 'tt46', 'link250')" onMouseOut="HideTip('tt46')">uc_first</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="text.title_case"></a>title_case</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string title_case(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Returns a copy of the given string with the first character of words uppercased and the remainder lowercased.</p><h4 class=CHeading>Argument</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>s</td><td class=CDLDescription>A string to be title-cased.</td></tr></table><h4 class=CHeading>Returns</h4><p>A copy of <b>s</b> with the first character of words uppercased and the remainder lowercased.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">assert( text::title_case( &quot;title case me!&quot; ) == &quot;Title Case Me!&quot; );</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#text.capitalize" class=LFunction id=link251 onMouseOver="ShowTip(event, 'tt2', 'link251')" onMouseOut="HideTip('tt2')">capitalize</a>, <a href="#text.lc_first" class=LFunction id=link252 onMouseOver="ShowTip(event, 'tt25', 'link252')" onMouseOut="HideTip('tt25')">lc_first</a>, <a href="#text.swap_case" class=LFunction id=link253 onMouseOver="ShowTip(event, 'tt43', 'link253')" onMouseOut="HideTip('tt43')">swap_case</a>, <a href="#text.uc_first" class=LFunction id=link254 onMouseOver="ShowTip(event, 'tt46', 'link254')" onMouseOut="HideTip('tt46')">uc_first</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="text.trim"></a>trim</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string trim(</td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap>int&nbsp;</td><td class="PType  prettyprint " nowrap>unsigned&nbsp;</td><td class="PParameter  prettyprint " nowrap>left</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0,</td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap>int&nbsp;</td><td class="PType  prettyprint " nowrap>unsigned&nbsp;</td><td class="PParameter  prettyprint " nowrap>right</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Returns a copy of the given string with the specified numbers of leading and trailing characters removed.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>s</td><td class=CDLDescription>A string to be trimmed.</td></tr><tr><td class=CDLEntry>left</td><td class=CDLDescription><span class="optional">optional</span> The number of leading characters to remove.&nbsp; The default is 0.</td></tr><tr><td class=CDLEntry>right</td><td class=CDLDescription><span class="optional">optional</span> The number of trailing characters to remove.&nbsp; The default is 0.</td></tr></table><h4 class=CHeading>Returns</h4><p>A copy of <b>s</b> with leading <b>left</b> characters and trailing <b>right</b> characters removed.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">assert( text::trim( &quot;trim me!&quot;       ) == &quot;trim me!&quot; );
assert( text::trim( &quot;trim me!&quot;, 1, 2 ) ==  &quot;rim m&quot;   );
assert( text::trim( &quot;trim me!&quot;, 3, 4 ) ==    &quot;m&quot;     );</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#text.chop" class=LFunction id=link255 onMouseOver="ShowTip(event, 'tt6', 'link255')" onMouseOut="HideTip('tt6')">chop</a>, <a href="#text.chomp" class=LFunction id=link256 onMouseOver="ShowTip(event, 'tt5', 'link256')" onMouseOut="HideTip('tt5')">chomp</a>, <a href="#text.delete" class=LFunction id=link257 onMouseOver="ShowTip(event, 'tt11', 'link257')" onMouseOut="HideTip('tt11')">delete</a>, <a href="#text.lstrip" class=LFunction id=link258 onMouseOver="ShowTip(event, 'tt27', 'link258')" onMouseOut="HideTip('tt27')">lstrip</a>, <a href="#text.rstrip" class=LFunction id=link259 onMouseOver="ShowTip(event, 'tt37', 'link259')" onMouseOut="HideTip('tt37')">rstrip</a>, <a href="#text.strip" class=LFunction id=link260 onMouseOver="ShowTip(event, 'tt42', 'link260')" onMouseOut="HideTip('tt42')">strip</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="text.uc_first"></a>uc_first</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string uc_first(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Returns a copy of the given string with the first character uppercased and the remainder unchanged.</p><h4 class=CHeading>Argument</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>s</td><td class=CDLDescription>An input string.</td></tr></table><h4 class=CHeading>Returns</h4><p>A copy of <b>s</b> with the first character uppercased and the remainder unchanged.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">assert( text::uc_first( &quot;upper CASE first&quot; ) == &quot;Upper CASE first&quot; );</pre></blockquote><h4 class=CHeading>See Also</h4><p><a href="#text.capitalize" class=LFunction id=link261 onMouseOver="ShowTip(event, 'tt2', 'link261')" onMouseOut="HideTip('tt2')">capitalize</a>, <a href="#text.lc_first" class=LFunction id=link262 onMouseOver="ShowTip(event, 'tt25', 'link262')" onMouseOut="HideTip('tt25')">lc_first</a>, <a href="#text.swap_case" class=LFunction id=link263 onMouseOver="ShowTip(event, 'tt43', 'link263')" onMouseOut="HideTip('tt43')">swap_case</a>, <a href="#text.title_case" class=LFunction id=link264 onMouseOver="ShowTip(event, 'tt44', 'link264')" onMouseOut="HideTip('tt44')">title_case</a></p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="text.untabify"></a>untabify</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string untabify(</td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap>int&nbsp;</td><td class="PType  prettyprint " nowrap>unsigned&nbsp;</td><td class="PParameter  prettyprint " nowrap>tab_size</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 8</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p><span class="static">static</span> Returns a copy of the given string where all tab characters (<b>\t</b>) are replaced by one or more spaces, depending on the tab positions.&nbsp; If a newline (<b>\n</b>) is found, it is copied and the tab position is reset.</p><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>s</td><td class=CDLDescription>A string to untabify.</td></tr><tr><td class=CDLEntry>tab_size</td><td class=CDLDescription><span class="optional">optional</span> Tab positions occur every <b>tab_size</b> characters.&nbsp; The default is 8.</td></tr></table><h4 class=CHeading>Returns</h4><p>A copy of <b>s</b> where all tab characters are replaced by one or more spaces, depending on the tab positions.</p><h4 class=CHeading>Example</h4><blockquote><pre class="prettyprint">assert( text::untabify( &quot;AB\tCDE\tFGHI\tJKLMN&quot; ) == &quot;AB      CDE     FGHI    JKLMN&quot; );
                                   // tab positions: ^       ^       ^       ^
assert( text::untabify( &quot;AB\tCDE\tFGHI\tJKLMN&quot;, 4 ) == &quot;AB  CDE FGHI    JKLMN&quot; );
                                   // tab positions:    ^   ^   ^   ^   ^   ^
assert( text::untabify( &quot;AB\nCDE\tFGHI\tJKLMN&quot;, 4 ) == &quot;AB\nCDE FGHI    JKLMN&quot; );
                                   // tab positions:    ^   ^   ^   ^   ^   ^</pre></blockquote></div></div></div>

</div><!--Content-->



<!--START_ND_TOOLTIPS-->
<div class=CToolTip id="tt1"><div class=CClass><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">virtual class text</td></tr></table></blockquote>Provides utility functions for text processing. </div></div><div class=CToolTip id="tt2"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string capitalize(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Returns a copy of the given string with the first character uppercased and the remainder lowercased.</div></div><div class=CToolTip id="tt3"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string center(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>width,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>byte&nbsp;</td><td class="PParameter  prettyprint " nowrap>fill_char</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> &quot; &quot;,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>bit&nbsp;</td><td class="PParameter  prettyprint " nowrap>trim_ends</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Returns a string of the specified width with the given string centerted and padded with the specified character.</div></div><div class=CToolTip id="tt4"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string change(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>sub,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>start_pos</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>end_pos</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> -1</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Returns a copy of the given string with the characters in the specified range replaced with the specified substring.</div></div><div class=CToolTip id="tt5"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string chomp(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Returns a copy of the given string with the last newline character removed (if present). </div></div><div class=CToolTip id="tt6"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function byte chop(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Returns the last character of the given string.</div></div><div class=CToolTip id="tt7"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string colorize(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>fg_color_e&nbsp;</td><td class="PParameter  prettyprint " nowrap>fg</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> FG_BLACK,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>bg_color_e&nbsp;</td><td class="PParameter  prettyprint " nowrap>bg</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> BG_WHITE,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>bit&nbsp;</td><td class="PParameter  prettyprint " nowrap>bold</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>bit&nbsp;</td><td class="PParameter  prettyprint " nowrap>underline</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>bit&nbsp;</td><td class="PParameter  prettyprint " nowrap>blink</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>bit&nbsp;</td><td class="PParameter  prettyprint " nowrap>reverse</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Returns a copy of the given string with ANSI escape codes.</div></div><div class=CToolTip id="tt8"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function bit contains(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>sub,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>start_pos</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>end_pos</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> -1</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Returns 1 if the given string contains the specified substring.</div></div><div class=CToolTip id="tt9"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string contains_str(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>sub,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>start_pos</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>end_pos</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> -1</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> If the given string contains the specified substring, returns that substring.</div></div><div class=CToolTip id="tt10"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function int unsigned count(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>sub,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>start_pos</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>end_pos</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> -1</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Returns the number of non-overlapping occurrences of the specified substring in the given string.</div></div><div class=CToolTip id="tt11"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string delete(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>sub,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>count</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> -1</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Returns a copy of the given string with the specified string removed.</div></div><div class=CToolTip id="tt12"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function bit ends_with(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>string_q&nbsp;</td><td class="PParameter  prettyprint " nowrap>suffixes,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>start_pos</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>end_pos</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> -1</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Returns 1 if the given string ends with one of the specified suffixes.</div></div><div class=CToolTip id="tt13"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function int find_any(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>string_q&nbsp;</td><td class="PParameter  prettyprint " nowrap>subs,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>start_pos</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>end_pos</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> -1</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Returns the lowest index in the given string where each specified substring is found.</div></div><div class=CToolTip id="tt14"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function int hash(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Returns the hash value of the given string. </div></div><div class=CToolTip id="tt15"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function int index(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>sub,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>start_pos</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>end_pos</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> -1</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Returns the index of the first occurrence of the specified substring in the given string within the optionally specified range.</div></div><div class=CToolTip id="tt16"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string insert(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>sub,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>start_pos</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Returns a copy of the given string with the specified substring inserted at the specified position.</div></div><div class=CToolTip id="tt17"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function bit is_alpha(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Returns 1 if all characters in the given string are alphabetic. </div></div><div class=CToolTip id="tt18"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function bit is_digit(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Returns 1 if all characters in the given string are digits. </div></div><div class=CToolTip id="tt19"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function bit is_lower(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Returns 1 if all <u>cased</u> characters in the given string are lowercase. </div></div><div class=CToolTip id="tt20"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function bit is_printable(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Returns 1 if all characters in the given string are printable. </div></div><div class=CToolTip id="tt21"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function bit is_single_bit_type(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Returns 1 if the given string is <b>bit</b>, <b>logic</b>, or <b>reg</b>.</div></div><div class=CToolTip id="tt22"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function bit is_space(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Returns 1 if all characters in the given string are whitespace characters: a space (&ldquo; &ldquo;), a tab (<b>\t</b>), or a newline (<b>\n</b>).</div></div><div class=CToolTip id="tt23"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function bit is_upper(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Returns 1 if all <u>cased</u> characters in the given string are uppercase. </div></div><div class=CToolTip id="tt24"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string join_str(</td><td class="PType  prettyprint " nowrap>string_q&nbsp;</td><td class="PParameter  prettyprint " nowrap>strings,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>separator</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> &quot;&quot;</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Returns a string by concatenating the strings in the given string queue, separated by the specified separator.</div></div><div class=CToolTip id="tt25"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string lc_first(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Returns a copy of the given string with the first character lowercased and the remainder unchanged.</div></div><div class=CToolTip id="tt26"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string ljust(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>width,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>byte&nbsp;</td><td class="PParameter  prettyprint " nowrap>fill_char</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> &quot; &quot;,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>bit&nbsp;</td><td class="PParameter  prettyprint " nowrap>trim_right</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Returns a string of the specified width with the given string left justified and padded with the specified character.</div></div><div class=CToolTip id="tt27"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string lstrip(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>chars</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> &quot; \t\n&quot;</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Returns a copy of the given string with leading characters removed.</div></div><div class=CToolTip id="tt28"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function bit only(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>chars</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Returns 1 if the given string consists of only the specified set of characters.</div></div><div class=CToolTip id="tt29"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function three_strings partition(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>sep</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Searches the first occurrence of the specified separator in the given string and returns an array of three strings. </div></div><div class=CToolTip id="tt30"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string replace(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>old_str,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>new_str,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>count</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> -1</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Returns a copy of the given string with the specified string replaced with a new string.</div></div><div class=CToolTip id="tt31"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string reverse(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Returns a copy of the given string with the characters in reverse order.</div></div><div class=CToolTip id="tt32"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function int rfind_any(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>string_q&nbsp;</td><td class="PParameter  prettyprint " nowrap>subs,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>start_pos</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>end_pos</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> -1</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Returns the highest index in the given string where each specified substring is found.</div></div><div class=CToolTip id="tt33"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function int rindex(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>sub,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>start_pos</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>end_pos</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> -1</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Returns the index of the last occurrence of the specified substring in the given string within the optionally specified range.</div></div><div class=CToolTip id="tt34"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string rjust(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>width,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>byte&nbsp;</td><td class="PParameter  prettyprint " nowrap>fill_char</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> &quot; &quot;,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>bit&nbsp;</td><td class="PParameter  prettyprint " nowrap>trim_left</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Returns a string of the specified width with the given string right justified and padded with the specified character.</div></div><div class=CToolTip id="tt35"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function three_strings rpartition(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>sep</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Searches the last occurrence of the specified separator in the given string and returns an array of three strings. </div></div><div class=CToolTip id="tt36"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string_q rsplit(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>sep</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> &quot;&quot;,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>max_split</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> -1</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Returns a queue of substrings by dividing the given string by the specified separator from the right.</div></div><div class=CToolTip id="tt37"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string rstrip(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>chars</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> &quot; \t\n&quot;</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Returns a copy of the given string with trailing characters removed.</div></div><div class=CToolTip id="tt38"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string slice(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>start_pos</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>end_pos</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> - 1</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Returns a substring in the specified range. </div></div><div class=CToolTip id="tt39"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string slice_len(</td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>start_pos</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0,</td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap>int&nbsp;</td><td class="PType  prettyprint " nowrap>unsigned&nbsp;</td><td class="PParameter  prettyprint " nowrap>length</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> s.len()</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Returns a substring in the specified range. </div></div><div class=CToolTip id="tt40"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string_q split(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>sep</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> &quot;&quot;,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>max_split</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> -1</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Returns a queue of substrings by dividing the given string by the specified separator.</div></div><div class=CToolTip id="tt41"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function bit starts_with(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>string_q&nbsp;</td><td class="PParameter  prettyprint " nowrap>prefixes,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>start_pos</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0,</td></tr><tr><td></td><td class="PType  prettyprint " nowrap>int&nbsp;</td><td class="PParameter  prettyprint " nowrap>end_pos</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> -1</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Returns 1 if the given string starts with one of the specified prefixes.</div></div><div class=CToolTip id="tt42"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string strip(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>chars</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> &quot; \t\n&quot;</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Returns a copy of the given string with leading and trailing characters removed.</div></div><div class=CToolTip id="tt43"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string swap_case(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Returns a copy of the given string with uppercase characters converted to lowercase, and lowercase characters converted to uppercase.</div></div><div class=CToolTip id="tt44"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string title_case(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Returns a copy of the given string with the first character of words uppercased and the remainder lowercased.</div></div><div class=CToolTip id="tt45"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string trim(</td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap>int&nbsp;</td><td class="PType  prettyprint " nowrap>unsigned&nbsp;</td><td class="PParameter  prettyprint " nowrap>left</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0,</td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap>int&nbsp;</td><td class="PType  prettyprint " nowrap>unsigned&nbsp;</td><td class="PParameter  prettyprint " nowrap>right</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 0</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Returns a copy of the given string with the specified numbers of leading and trailing characters removed.</div></div><div class=CToolTip id="tt46"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string uc_first(</td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Returns a copy of the given string with the first character uppercased and the remainder unchanged.</div></div><div class=CToolTip id="tt47"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class="PBeforeParameters  prettyprint "nowrap>static function string untabify(</td><td class="PTypePrefix  prettyprint " nowrap></td><td class="PType  prettyprint " nowrap>string&nbsp;</td><td class="PParameter  prettyprint " nowrap>s,</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%></td></tr><tr><td></td><td class="PTypePrefix  prettyprint " nowrap>int&nbsp;</td><td class="PType  prettyprint " nowrap>unsigned&nbsp;</td><td class="PParameter  prettyprint " nowrap>tab_size</td><td class="PDefaultValuePrefix  prettyprint ">&nbsp;=&nbsp;</td><td class="PDefaultValue  prettyprint " width=100%> 8</td><td class="PAfterParameters  prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><span class="static">static</span> Returns a copy of the given string where all tab characters (<b>\t</b>) are replaced by one or more spaces, depending on the tab positions. </div></div><div class=CToolTip id="tt48"><div class=CType><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">typedef enum { FG_BLACK = 30, FG_RED = 31, FG_GREEN = 32, FG_YELLOW = 33, FG_BLUE = 34, FG_MAGENTA = 35, FG_CYAN = 36, FG_WHITE = 37 } fg_color_e</td></tr></table></blockquote>The enumerated type of foreground colors.</div></div><div class=CToolTip id="tt49"><div class=CType><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">typedef enum { BG_BLACK = 40, BG_RED = 41, BG_GREEN = 42, BG_YELLOW = 43, BG_BLUE = 44, BG_MAGENTA = 45, BG_CYAN = 46, BG_WHITE = 47 } bg_color_e</td></tr></table></blockquote>The enumerated type of background colors.</div></div><div class=CToolTip id="tt50"><div class=CType><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype"><tr><td class="prettyprint">typedef string string_q[$]</td></tr></table></blockquote>The queue of strings.</div></div><!--END_ND_TOOLTIPS-->

<script language=JavaScript><!--
if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html>